| Anonymous | Login | Signup for a new account | 2013-05-24 22:18 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0021965 | FPC | Database Components | public | 2012-05-06 19:01 | 2012-06-30 21:00 | ||||
| Reporter | Ludo Brands | ||||||||
| Assigned To | Joost van der Sluis | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||
| Status | closed | Resolution | fixed | ||||||
| Platform | OS | OS Version | |||||||
| Product Version | 2.7.1 | Product Build | 21208 | ||||||
| Target Version | Fixed in Version | 2.7.1 | |||||||
| Summary | 0021965: [Patch] TCustomSQLQuery.SQLParser fails when keyword is followed immediately by a left bracket | ||||||||
| Description | A query such as 'select * from test where(id<>''00'')' is reported as read only because the parser never finds the "where" clause. Patch attached. | ||||||||
| Tags | No tags attached. | ||||||||
| FPCOldBugId | |||||||||
| Fixed in Revision | 21742 | ||||||||
| Attached Files | |||||||||
Relationships |
|||||||
|
|||||||
Notes |
|
|
(0059466) LacaK2 (reporter) 2012-05-10 13:58 |
I am playing with parsing of sql statements with more complicated embedded comments like: SQL.Text:='/**/SELECT * FROM/*a*/test --comment'0000013'/*WHERE(a>1)*/where/*a*/(a>3)/*c*/order by 1' Where extracting for example TableName is more complicated. So my question is if it is worth to rework parser to support it or simply do not support it and resigned to it. |
|
(0059481) LacaK2 (reporter) 2012-05-11 14:10 |
Testing patch in conjuction with ServerFilter reveals another bug. (it seems, that SQLParser do not correctly set FWhereStartPos and/or FWhereStopPos) See attached patch for test suite (in future we may add there other more complex situations) |
|
(0059577) LacaK2 (reporter) 2012-05-14 12:20 |
Please look at patch 2. There are some improvements: * fixed bug in AddFilter * recognizes embedded comments /*..*/ * recognizes TableName in FROM part when used alias (SELECT ... FROM table [AS] t) * recognizes ROWS (Firebird alternative to LIMIT) Also tests updated. |
|
(0059605) LacaK2 (reporter) 2012-05-15 09:51 edited on: 2012-05-15 09:53 |
Patch 2a. Small improvements. (f.e. MySQL requires space after -- comment start) |
|
(0060755) Marco van de Voort (manager) 2012-06-30 19:53 |
Committed. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-05-06 19:01 | Ludo Brands | New Issue | |
| 2012-05-06 19:01 | Ludo Brands | Status | new => assigned |
| 2012-05-06 19:01 | Ludo Brands | Assigned To | => Joost van der Sluis |
| 2012-05-06 19:01 | Ludo Brands | File Added: sqldb.diff | |
| 2012-05-10 13:58 | LacaK2 | Note Added: 0059466 | |
| 2012-05-11 14:10 | LacaK2 | Note Added: 0059481 | |
| 2012-05-11 14:11 | LacaK2 | File Added: testfieldtypes.pas.diff1 | |
| 2012-05-14 12:20 | LacaK2 | Note Added: 0059577 | |
| 2012-05-14 12:20 | LacaK2 | File Added: testfieldtypes.pas.diff2 | |
| 2012-05-14 12:21 | LacaK2 | File Added: sqldb.pp.diff2 | |
| 2012-05-15 09:51 | LacaK2 | Note Added: 0059605 | |
| 2012-05-15 09:52 | LacaK2 | File Added: sqldb.pp.diff2a | |
| 2012-05-15 09:52 | LacaK2 | File Added: testfieldtypes.pas.diff2a | |
| 2012-05-15 09:53 | LacaK2 | Note Edited: 0059605 | |
| 2012-06-30 19:53 | Marco van de Voort | Fixed in Revision | => 21742 |
| 2012-06-30 19:53 | Marco van de Voort | Status | assigned => resolved |
| 2012-06-30 19:53 | Marco van de Voort | Fixed in Version | => 2.7.1 |
| 2012-06-30 19:53 | Marco van de Voort | Resolution | open => fixed |
| 2012-06-30 19:53 | Marco van de Voort | Note Added: 0060755 | |
| 2012-06-30 21:00 | Ludo Brands | Status | resolved => closed |
| 2012-10-27 11:48 | Ludo Brands | Relationship added | parent of 0022001 |
| Main | My View | View Issues | Change Log | Roadmap |



