From 4f6324e9ebdeb3b605ff2551f1c8d46803443861 Mon Sep 17 00:00:00 2001 From: rokmcssu Date: Fri, 13 Jul 2007 09:25:09 +0000 Subject: [PATCH] =?UTF-8?q?68,=2069=EB=B2=88=20=ED=8B=B0=EC=BC=93=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=EC=88=98=EC=A0=95.=20update=EB=AC=B8=20se?= =?UTF-8?q?lect=20*=EB=AC=B8=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/trunk@1937 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/db/DBCubrid.class.php | 62 ++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php index 55171301b..bd49de1da 100644 --- a/classes/db/DBCubrid.class.php +++ b/classes/db/DBCubrid.class.php @@ -143,6 +143,7 @@ * return\n **/ function _query($query) { + //echo "(((".$this->backtrace().")))"; if(!$query || !$this->isConnected()) return; // 쿼리 시작을 알림 @@ -383,7 +384,7 @@ function _executeUpdateAct($output) { // 테이블 정리 foreach($output->tables as $key => $val) { - $table_list[] = '`'.$this->prefix.$key.'` as '.$val; + $table_list[] = "\"".$this->prefix.$key."\" as ".$val; } // 컬럼 정리 @@ -396,7 +397,7 @@ if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; elseif(!$value || is_numeric($value)) $value = (int)$value; - $column_list[] = sprintf("`%s` = %s", $name, $value); + $column_list[] = sprintf("\"%s\" = %s", $name, $value); } } @@ -453,8 +454,9 @@ } else { if(strpos($name,'.')!=false) { list($prefix, $name) = explode('.',$name); - if($alias) $column_list[] = sprintf('%s."%s" as "%s"', $prefix, $name, $alias); - else $column_list[] = sprintf('%s."%s"',$prefix,$name); + $deli=($name == '*') ? "" : "\""; + if($alias) $column_list[] = sprintf("%s.$deli%s$deli as \"%s\"", $prefix, $name, $alias); + else $column_list[] = sprintf("%s.$deli%s$deli",$prefix,$name); } else { if($alias) $column_list[] = sprintf('%s as "%s"', $name, $alias); else $column_list[] = sprintf('%s',$name); @@ -488,6 +490,58 @@ return $buff; } + /** + * @brief 현재 시점의 Stack trace를 보여줌.결과를 fetch + **/ + function backtrace() + { + $output = "
\n"; + $output .= "Backtrace:
\n"; + $backtrace = debug_backtrace(); + + foreach ($backtrace as $bt) { + $args = ''; + foreach ($bt['args'] as $a) { + if (!empty($args)) { + $args .= ', '; + } + switch (gettype($a)) { + case 'integer': + case 'double': + $args .= $a; + break; + case 'string': + $a = htmlspecialchars(substr($a, 0, 64)).((strlen($a) > 64) ? '...' : ''); + $args .= "\"$a\""; + break; + case 'array': + $args .= 'Array('.count($a).')'; + break; + case 'object': + $args .= 'Object('.get_class($a).')'; + break; + case 'resource': + $args .= 'Resource('.strstr($a, '#').')'; + break; + case 'boolean': + $args .= $a ? 'True' : 'False'; + break; + case 'NULL': + $args .= 'Null'; + break; + default: + $args .= 'Unknown'; + } + } + $output .= "
\n"; + $output .= "file: {$bt['line']} - {$bt['file']}
\n"; + $output .= "call: {$bt['class']}{$bt['type']}{$bt['function']}($args)
\n"; + } + $output .= "
\n"; + return $output; + } + + /** * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 *