-/* Generated by re2c 0.5 on Tue May 18 15:32:50 2004 */
-#line 1 "/home/rei/php5/ext/pdo/pdo_sql_parser.re"
+/* Generated by re2c 0.5 on Thu May 20 12:43:08 2004 */
+#line 1 "/home/george/src/pecl/pdo/pdo_sql_parser.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
160, 224, 224, 224, 224, 224, 224, 224,
224, 224, 224, 224, 224, 224, 224, 224,
224, 224, 224, 224, 224, 224, 224, 224,
- 224, 224, 224, 160, 32, 160, 160, 160,
+ 224, 224, 224, 160, 32, 160, 160, 224,
160, 224, 224, 224, 224, 224, 224, 224,
224, 224, 224, 224, 224, 224, 224, 224,
224, 224, 224, 224, 224, 224, 224, 224,
*outquery_len += (s.cur - s.tok);
}
else if(t == PDO_PARSER_BIND) {
+ char crutch;
if(!params) {
/* error */
efree(*outquery);
return 0;
}
/* lookup bind first via hash and then index */
- if((SUCCESS == zend_hash_find(params, s.tok+1, s.cur-s.tok,(void **)¶m))
+ /* stupid keys need to be null-terminated, even though we know their length */
+ crutch = s.tok[s.cur-s.tok + 1];
+ s.tok[s.cur-s.tok] = '\0';
+ if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok + 1,(void **)¶m))
||
(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m)))
{
char *quotedstr;
int quotedstrlen;
+ /* restore the in-string key, doesn't need null-termination here */
+ s.tok[s.cur-s.tok] = crutch;
/* currently everything is a string here */
/* quote the bind value if necessary */
*outquery_len += (s.cur - s.tok);
}
else if(t == PDO_PARSER_BIND) {
+ char crutch;
if(!params) {
/* error */
efree(*outquery);
return 0;
}
/* lookup bind first via hash and then index */
- if((SUCCESS == zend_hash_find(params, s.tok+1, s.cur-s.tok,(void **)¶m))
+ /* stupid keys need to be null-terminated, even though we know their length */
+ crutch = s.tok[s.cur-s.tok + 1];
+ s.tok[s.cur-s.tok] = '\0';
+ if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok + 1,(void **)¶m))
||
(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m)))
{
char *quotedstr;
int quotedstrlen;
+ /* restore the in-string key, doesn't need null-termination here */
+ s.tok[s.cur-s.tok] = crutch;
/* currently everything is a string here */
/* quote the bind value if necessary */