Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.7.0

Request #7416 PATCH NEEDED - Pound Sign Breaking Legal Field Names
Submitted: 2006-04-18 12:22 UTC
From: maps at servangle dot net Assigned:
Status: Open Package: SQL_Parser (version 0.5)
PHP Version: all OS: Solaris & DB2
Roadmaps: (Not assigned)    
Subscription  


 [2006-04-18 12:22 UTC] maps at servangle dot net (J Randolph)
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.

Comments

 [2007-06-28 11:57 UTC] cybot (Sebastian Mendel)
# is treated as start for a comment what seems not valid for ANSI SQL
 [2007-06-28 13:32 UTC] cybot (Sebastian Mendel)
#11472 is required for further work on this
 [2007-07-13 13:48 UTC] cybot (Sebastian Mendel)
comments works well now, but this needs support for DB2 SQL dialect
 [2011-02-14 10:25 UTC] alan_k (Alan Knowles)
-Summary: Pound Sign Breaking Legal Field Names +Summary: PATCH NEEDED - Pound Sign Breaking Legal Field Names
needs a Dialect file for DB2 (which does not include '#' as a comment seperator..