FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=7416&edit=1

ID: 7416
Updated by: alan@akbkhome.com
Reported By: maps at servangle dot net
-Summary: Pound Sign Breaking Legal Field Names
+Summary: PATCH NEEDED - Pound Sign Breaking Legal Field Names
Status: Open
Type: Feature/Change Request
Package: SQL_Parser
Operating System: Solaris & DB2
Package Version: 0.5
PHP Version: all
Roadmap Versions:
New Comment:

-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..


Previous Comments:
------------------------------------------------------------------------

[2007-07-13 09:48:57] cybot

comments works well now,

but this needs support for DB2 SQL dialect

------------------------------------------------------------------------

[2007-06-28 09:32:46] cybot

#11472 is required for further work on this

------------------------------------------------------------------------

[2007-06-28 07:57:50] cybot

# is treated as start for a comment

what seems not valid for ANSI SQL

------------------------------------------------------------------------

[2006-04-18 08:22:09] 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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedFeb 14, '11 at 4:22a
activeFeb 14, '11 at 4:22a
posts1
users1
websitepear.php.net

1 user in discussion

Alan: 1 post

People

Translate

site design / logo © 2022 Grokbase