-C If\ssqlite3_column_value()\sis\scalled\sto\sobtain\sa\svalue\swith\sthe\sMEM_Static\sflag\sset,\sclear\sit\sand\sset\sthe\sMEM_Ephem\sflag\sbefore\sreturning.\sOtherwise,\sif\sthe\svalue\sis\spassed\sto\ssqlite3_bind_value()\sor\ssqlite3_result_value(),\ssqlite\smay\sattempt\sto\suse\sthe\sbuffer\safter\sthe\sstatement\shas\sbeen\sfinalized.\sThis\sis\snot\salways\svalid,\sas\sMEM_Static\sonly\sguarantees\sthat\sa\sMEM.z\sbuffer\swill\sbe\svalid\sfor\sthe\slifetime\sof\sthe\sowner\sstatement,\snot\sthat\sit\sis\sactually\sa\sstatic\sbuffer.\s(CVS\s5812)
-D 2008-10-13T10:37:50
+C Use\sone\sless\stemporary\stable\sin\sgenfkey.c.\sThe\sretired\stable\swas\sbeing\sused\sto\sworkaround\sthe\sbug\sfixed\sby\s(5812).\s(CVS\s5813)
+D 2008-10-13T10:56:48
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 2014e5a4010ad5ebbcaedff98240b3d14ee83838
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/genfkey.README d94b4423eef29e662898948f04a7dbe210c35e7a
-F tool/genfkey.c 021979c7d2a58a230508b976095260a98c509cae
+F tool/genfkey.c e1b9c93da828db10c1109c7b4fa611aec8adc407
F tool/genfkey.test 182829596fb15785b94b2493c5f735b847d91076
F tool/lemon.c 6cb39632ef3bfec2cea8f81b4d7f63c09fe12802
F tool/lempar.c 770dc64b74429daf9611676f43bfbd7c1bed0152
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 500c50561fba88948aad21d1aef1e1e96ab8c3aa
-R c4ea9493401c6b826e996873ceae56db
+P b055bfc4e5268d8a66d6a4f5e8aec1285fe4b8e7
+R a7f9557fc9b70a138a1706f314cf9726
U danielk1977
-Z e0758c74c431a8022c7792359e9dbeb0
+Z 55e2fccdb1a78cce9b6aee3d77c5f37e
** This file contains C code for 'genfkey', a program to generate trigger
** definitions that emulate foreign keys. See genfkey.README for details.
**
-** $Id: genfkey.c,v 1.1 2008/10/10 17:58:27 danielk1977 Exp $
+** $Id: genfkey.c,v 1.2 2008/10/13 10:56:48 danielk1977 Exp $
*/
#include "sqlite3.h"
"CREATE TABLE temp.fkey AS "
"SELECT from_tbl, to_tbl, fkid, from_col, to_col, on_update, on_delete "
"FROM temp.v_fkey WHERE database = 'main';"
- "CREATE TABLE temp.col AS "
- "SELECT * FROM temp.v_col WHERE database = 'main';"
, 0, 0, pzErr
);
"SELECT fkid, from_tbl "
"FROM temp.fkey "
"WHERE to_col IS NOT NULL AND NOT EXISTS (SELECT 1 "
- "FROM temp.col WHERE tablename=to_tbl AND name==to_col"
+ "FROM temp.v_col WHERE tablename=to_tbl AND name==to_col"
")", pHasErrors
);
if( rc!=SQLITE_OK ) return rc;
"SELECT fkid, from_tbl "
"FROM temp.fkey "
"WHERE to_col IS NULL AND NOT EXISTS "
- "(SELECT 1 FROM temp.col WHERE pk AND tablename = temp.fkey.to_tbl)"
+ "(SELECT 1 FROM temp.v_col WHERE pk AND tablename = temp.fkey.to_tbl)"
, pHasErrors
);
if( rc!=SQLITE_OK ) return rc;
/* Fix all the implicit primary key mappings in the temp.fkey table. */
rc = sqlite3_exec(db,
"UPDATE temp.fkey SET to_col = "
- "(SELECT name FROM temp.col WHERE pk AND tablename=temp.fkey.to_tbl)"
+ "(SELECT name FROM temp.v_col WHERE pk AND tablename=temp.fkey.to_tbl)"
" WHERE to_col IS NULL;"
, 0, 0, pzErr
);
"ii.name AS col "
"FROM temp.v_idxlist AS il, temp.v_idxinfo AS ii "
"WHERE il.isunique AND il.database='main' AND ii.indexname = il.name;"
- "INSERT INTO temp.idx2 SELECT tablename, 'pk', name FROM temp.col WHERE pk;"
+ "INSERT INTO temp.idx2 "
+ "SELECT tablename, 'pk', name FROM temp.v_col WHERE pk;"
"CREATE TABLE temp.idx AS SELECT "
"tablename, indexname, sj(dq(col),',') AS cols "