Avoid surplus bytes at the end of the keyword string table.

Add testcase() macros to make sure all keywords are used during
testing. (CVS 6090)

FossilOrigin-Name: 73958060aaf641d93bede3a42851e5b3451f5432
This commit is contained in:
drh
2008-12-31 21:52:40 +00:00
parent 42128b9e33
commit f3d20c04a2
3 changed files with 15 additions and 10 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
C Fix\sthe\sname\sin\sthe\sdocumentation\sof\sthe\scompile-time\smacro\sfor\nenabling\sFTS3\sparenthesis\sprocessing.\s(CVS\s6089)
D 2008-12-31T19:27:53
C Avoid\ssurplus\sbytes\sat\sthe\send\sof\sthe\skeyword\sstring\stable.\nAdd\stestcase()\smacros\sto\smake\ssure\sall\skeywords\sare\sused\sduring\ntesting.\s(CVS\s6090)
D 2008-12-31T21:52:41
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 77635d0909c2067cee03889a1e04ce910d8fb809
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -671,7 +671,7 @@ F tool/lempar.c c9151d2a4adf418fd9c3970dbb923b7a188b37c2
F tool/memleak.awk 4e7690a51bf3ed757e611273d43fe3f65b510133
F tool/memleak2.awk 9cc20c8e8f3c675efac71ea0721ee6874a1566e8
F tool/memleak3.tcl 7707006ee908cffff210c98158788d85bb3fcdbf
F tool/mkkeywordhash.c 698ea044ca0b49bde8a9f3ce6429e8dc5a259d25
F tool/mkkeywordhash.c 1583825e96c08491c288c190a569293d3d91686f
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c.tcl bc7c626adfca5aa022454a411a62e81e7204339e
@@ -689,7 +689,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 7e238e8604b9a9f786d84a47d21c6b42f1585755
R ea0c7656efc415f015d8861f520d7719
P ac8258da6ecd3ea37f394dc3b48834eb57832cf4
R d5d57135dc547a2e598a1cd9116c3393
U drh
Z 26fd3361c146d29a622a0e47839ead1e
Z cca5bd2d5683c469a6e1e0daad05eadf
+1 -1
View File
@@ -1 +1 @@
ac8258da6ecd3ea37f394dc3b48834eb57832cf4
73958060aaf641d93bede3a42851e5b3451f5432
+8 -3
View File
@@ -15,7 +15,7 @@ static const char zHdr[] =
"**\n"
"** The code in this file has been automatically generated by\n"
"**\n"
"** $Header: /home/drh/sqlite/trans/cvs/sqlite/sqlite/tool/mkkeywordhash.c,v 1.35 2008/12/17 17:30:26 danielk1977 Exp $\n"
"** $Header: /home/drh/sqlite/trans/cvs/sqlite/sqlite/tool/mkkeywordhash.c,v 1.36 2008/12/31 21:52:41 drh Exp $\n"
"**\n"
"** The code in this file implements a function that determines whether\n"
"** or not a given identifier is really an SQL keyword. The same thing\n"
@@ -485,8 +485,9 @@ int main(int argc, char **argv){
if( j>0 ){
printf("%*s */\n", 74-j, "");
}
printf(" static const char zText[%d] = {\n", nChar+1);
for(i=j=0; i<=k; i++){
printf(" static const char zText[%d] = {\n", nChar);
zText[nChar] = 0;
for(i=j=0; i<k; i++){
if( j==0 ){
printf(" ");
}
@@ -573,6 +574,10 @@ int main(int argc, char **argv){
printf(" for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n");
printf(" if( aLen[i]==n &&"
" sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n");
for(i=0; i<nKeyword; i++){
printf(" testcase( i==%d ); /* %s */\n",
i, aKeywordTable[i].zTokenType);
}
printf(" return aCode[i];\n");
printf(" }\n");
printf(" }\n");