summaryrefslogtreecommitdiffstats
path: root/codebase/db_common.php
diff options
context:
space:
mode:
authorStanislau <stanislau.wolski@gmail.com>2011-11-10 16:33:52 +0300
committerStanislau <stanislau.wolski@gmail.com>2011-11-10 16:33:52 +0300
commit7a79e1d9a75908f8f36c43117dbc1be95ee363fa (patch)
tree916989740fbd53ca7c0a8f2c3128973676929ad4 /codebase/db_common.php
parent8363feeef23aca83cebc8b3a1dcd6802398f5ced (diff)
downloadconnector-php-7a79e1d9a75908f8f36c43117dbc1be95ee363fa.zip
connector-php-7a79e1d9a75908f8f36c43117dbc1be95ee363fa.tar.gz
connector-php-7a79e1d9a75908f8f36c43117dbc1be95ee363fa.tar.bz2
[add] render_complex_sql - renders by sql, preserving it as is
Diffstat (limited to 'codebase/db_common.php')
-rw-r--r--codebase/db_common.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/codebase/db_common.php b/codebase/db_common.php
index 816f332..996feda 100644
--- a/codebase/db_common.php
+++ b/codebase/db_common.php
@@ -215,7 +215,12 @@ class DataRequestConfig{
@param sql
incoming sql string
*/
- public function parse_sql($sql){
+ public function parse_sql($sql, $as_is = false){
+ if ($as_is){
+ $this->fieldset = $sql;
+ return;
+ }
+
$sql= preg_replace("/[ \n\t]+limit[\n\t ,0-9]*$/i","",$sql);
$data = preg_split("/[ \n\t]+\\_from\\_/i",$sql,2);
@@ -224,7 +229,7 @@ class DataRequestConfig{
$this->fieldset = preg_replace("/^[\s]*select/i","",$data[0],1);
//Ignore next type of calls
- //direct call to stored procedure without FROM
+ //direct call to stored procedure without FROM
if ((count($data) == 1) ||
//UNION select
preg_match("#[ \n\r\t]union[ \n\t\r]#i", $sql)){