From: Vikram A. <noe...@gm...> - 2010-12-26 01:34:52
|
I'm working on a patch for the sqlite3 driver to resolve some of the issues I've been having. The first issue I had was that the parser was unable to find Tables in the SQL statement. This was because the parser assumed that the only possible white space around keywords was ' ' or 0x20; eg. strstr(statement," FROM "); If you had SQL formatted like; SELECT foo\nFROM bar; or SELECT foo\n\tFROM bar; The parser would fail to find 'bar' because there isn't a ' ' character before FROM. This was a problem for all keywords. I think using strtok would have been a better approach than going char by char. But since the parser works in general, I didn't want to rewrite it all. The second bug was that the parser would always read past the first "endword" if there was a JOIN just before it. Resulting in tables being added to the list that don't exist. (eg. Artist.name, not a table but a field). Thus in order to fix this you need to check for endwords right away if you're parsing through JOINs. I'm still having all sorts of issues with the sqlite3 driver but these two things have at least got my application running :) I also removed some magic references to nottables[] and added some comments to denote the end of large statements. I ran make check with the patch and 380 tests passed, 0 failed. Let me know what you think of the patch. On a side note, write performance to sqlite3 db is incredibly poor (>1s for each INSERT regardless of content or no. of fields). But read performance is great. Any tips on how to tune sqlite3? Vikram. |