Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix a segfault that can be caused by an INSTEAD OF trigger on a view that includes an expression of the form "table.column" in the select list. (CVS 5940) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
88a09dbb4b54be4010aae767157a1e20 |
User & Date: | danielk1977 2008-11-21 16:22:18 |
Context
2008-11-21
| ||
16:58 | Fix the OOM handling for explain statements so that it is the same as for regular statements if the OOM error occurs from within a call to sqlite3_column_text() or text16(). (CVS 5941) check-in: 891b14e1 user: danielk1977 tags: trunk | |
16:22 | Fix a segfault that can be caused by an INSTEAD OF trigger on a view that includes an expression of the form "table.column" in the select list. (CVS 5940) check-in: 88a09dbb user: danielk1977 tags: trunk | |
09:43 | Fix an assert() failure that can occur after an OOM error. (CVS 5939) check-in: 4c765758 user: danielk1977 tags: trunk | |
Changes
Changes to src/select.c.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
|
** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** ** $Id: select.c,v 1.487 2008/11/21 09:43:20 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** Delete all the content of a Select structure but do not deallocate ** the select structure itself. ................................................................................ /* For columns use the column name name */ int iCol = pCol->iColumn; if( iCol<0 ) iCol = pTab->iPKey; zName = sqlite3MPrintf(db, "%s", iCol>=0 ? pTab->aCol[iCol].zName : "rowid"); }else{ /* Use the original text of the column expression as its name */ zName = sqlite3MPrintf(db, "%T", &pCol->span); } } if( db->mallocFailed ){ sqlite3DbFree(db, zName); break; } sqlite3Dequote(zName); |
|
>
|
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
|
** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** ** $Id: select.c,v 1.488 2008/11/21 16:22:18 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** Delete all the content of a Select structure but do not deallocate ** the select structure itself. ................................................................................ /* For columns use the column name name */ int iCol = pCol->iColumn; if( iCol<0 ) iCol = pTab->iPKey; zName = sqlite3MPrintf(db, "%s", iCol>=0 ? pTab->aCol[iCol].zName : "rowid"); }else{ /* Use the original text of the column expression as its name */ Token *pToken = (pCol->span.z?&pCol->span:&pCol->token); zName = sqlite3MPrintf(db, "%T", pToken); } } if( db->mallocFailed ){ sqlite3DbFree(db, zName); break; } sqlite3Dequote(zName); |
Changes to test/trigger2.test.
730 731 732 733 734 735 736 737 738 739 740 741 742 |
INSERT INTO v1log VALUES(OLD.x,NEW.x,OLD.y,NEW.y,OLD.z,NEW.z); END; DELETE FROM v1log; UPDATE v1 SET x=x+100, y=y+200, z=z+300; SELECT * FROM v1log; } } {3 103 5 205 4 304 9 109 11 211 10 310} } ;# ifcapable view integrity_check trigger2-9.9 finish_test |
> > > > > > > > > > > > |
730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 |
INSERT INTO v1log VALUES(OLD.x,NEW.x,OLD.y,NEW.y,OLD.z,NEW.z); END; DELETE FROM v1log; UPDATE v1 SET x=x+100, y=y+200, z=z+300; SELECT * FROM v1log; } } {3 103 5 205 4 304 9 109 11 211 10 310} # At one point the following was causing a segfault. do_test trigger2-9.1 { execsql { CREATE TABLE t3(a TEXT, b TEXT); CREATE VIEW v3 AS SELECT t3.a FROM t3; CREATE TRIGGER trig1 INSTEAD OF DELETE ON v3 BEGIN SELECT 1; END; DELETE FROM v3 WHERE a = 1; } } {} } ;# ifcapable view integrity_check trigger2-9.9 finish_test |