Home » Database » SQL_Parser » Bug #7416
PATCH NEEDED - Pound Sign Breaking Legal Field Names
Details
| Request #7416 | PATCH NEEDED - Pound Sign Breaking Legal Field Names |
|---|---|
| Submitted | 2006-04-18 12:22 UTC |
| From | maps at servangle dot net |
| Status | Open |
| Package | SQL_Parser |
| PHP Version | all |
| OS | Solaris & DB2 |
| Roadmaps | (Not assigned) |
Comments
[2006-04-18 12:22 UTC] maps at servangle dot net
Description:
------------
Pound sign's (#) are breaking the SQL parsing. The pound sign is a legal character representation in DB2 field names. Example:
SELECT * FROM DB2TEST.MYTABLE WHERE TOT#CUST = '1'
Test script:
---------------
Recommended patches:
Lexer.php (line:246)
if (ctype_alpha(ord($c))) { // keyword or ident
--change to--
if (ctype_alpha(ord($c)) || ($c == '#' )) { // keyword or ident
Lexer.php (line:304)
if (ctype_alnum(ord($c)) || ($c == '_') || ($c == '.')) {
--change to--
if (ctype_alnum(ord($c)) || ($c == '_') || ($c == '.') || ($c == '#')) {
Expected result:
----------------
Successfully parsed SQL statement.
Actual result:
--------------
Partially parsed SQL statement. The parser seems to jump out of parsing when a # sign is encountered.