|
|
| version 1.3, 2001/11/11 11:01:47 | version 1.5, 2002/02/08 07:28:25 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser PgSQL driver. | Parser PgSQL driver. |
| Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com) | Copyright(c) 2001, 2002 ArtLebedev Group(http://www.artlebedev.com) |
| Author: Alexander Petrosyan <paf@design.ru>(http://design.ru/paf) | Author: Alexander Petrosyan <paf@design.ru>(http://design.ru/paf) |
| Line 123 public: | Line 123 public: |
| unsigned int quote( | unsigned int quote( |
| SQL_Driver_services&, void *connection, | SQL_Driver_services&, void *connection, |
| char *to, const char *from, unsigned int length) { | char *to, const char *from, unsigned int length) { |
| /* | if(to) { // store mode |
| it's already UNTAINT_TIMES_BIGGER | unsigned int result=length; |
| */ | while(length--) { |
| unsigned int result=length; | switch(*from) { |
| while(length--) { | case '\'': // "'" -> "''" |
| switch(*from) { | *to++='\''; result++; |
| case '\'': // "'" -> "''" | break; |
| *to++='\''; | case '\\': // "\" -> "\\" |
| break; | *to++='\''; result++; |
| case '\\': // "\" -> "\\" | break; |
| *to++='\''; | } |
| break; | *to++=*from++; |
| } | } |
| *to++=*from++; | return result; |
| } | } else // estimate mode |
| return result; | return length*2; |
| } | } |
| void query( | void query( |
| SQL_Driver_services& services, void *connection, | SQL_Driver_services& services, void *connection, |