Re: Re: cvs: php-src /ext/pdo pdo_sql_parser.cpdo_sql_parser.re/ext/pdo/tests bug_43130.phpt

From: Date: Fri, 16 Nov 2007 11:00:21 +0000
Subject: Re: Re: cvs: php-src /ext/pdo pdo_sql_parser.cpdo_sql_parser.re/ext/pdo/tests bug_43130.phpt
References: 1 2 3 4 5 6 7  Groups: php.cvs php.internals 
Request: Send a blank email to internals+get-33176@lists.php.net to get a copy of this message
Lorenzo Alberton wrote:
I talked to Christopher Jones (of Oracle fame) and Lorenzo (MDB2 maintainer). Its clear that the only named parameter supporting database I know does not support dash inside named parameters. Its also dangerous since it means that whitespace typos could have serious hard to spot issues. I think a safe regexp for bound parameters would look something like: /^[a-z0-9][a-z0-9_]{0,30}$/
Since I couldn't find any official reference in the oracle documentation, I did further tests.
[...]
so please someone revert this change ... or better yet implement the above rules.
I won't like having vendor specific rules there but a subset which works with most/all backends and which should full-fill most user's needs. The regexp from above looks like a good compromise for me.
This one is safer: /^((?:\d+)|(?:[a-z][a-z0-9_]*))$/i
or better yet: /^((?:\d+)|(?:[a-z][a-z0-9_]{0,29}))$/i Best regards, -- Lorenzo Alberton http://pear.php.net/user/quipo ________________________________________________________________________ Quipo Free Internet: sicuro e veloce senza costi di attivazione e senza canone, 2 e-mail da 25 Mb, 150 Mb di spazio web e molto di più! Registrati gratis: http://www.quipo.it

« previous php.internals (#33176) next »