mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 20:44:28 +09:00
쿼리에 연산식이 들어갈때 처리 부분에 정규식을 이용하여 처리하게 수정함
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6555 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2d6a816819
commit
a8261cef00
1 changed files with 39 additions and 49 deletions
|
|
@ -30,8 +30,8 @@
|
||||||
'number' => 'INTEGER',
|
'number' => 'INTEGER',
|
||||||
'varchar' => 'VARCHAR',
|
'varchar' => 'VARCHAR',
|
||||||
'char' => 'CHAR',
|
'char' => 'CHAR',
|
||||||
'text' => 'BLOB SUB_TYPE TEXT SEGMENT SIZE 20',
|
'text' => 'BLOB SUB_TYPE TEXT SEGMENT SIZE 32',
|
||||||
'bigtext' => 'BLOB SUB_TYPE TEXT SEGMENT SIZE 20',
|
'bigtext' => 'BLOB SUB_TYPE TEXT SEGMENT SIZE 32',
|
||||||
'date' => 'VARCHAR(14)',
|
'date' => 'VARCHAR(14)',
|
||||||
'float' => 'FLOAT',
|
'float' => 'FLOAT',
|
||||||
);
|
);
|
||||||
|
|
@ -723,25 +723,15 @@
|
||||||
ibase_blob_add($blh, $value);
|
ibase_blob_add($blh, $value);
|
||||||
$value = ibase_blob_close($blh);
|
$value = ibase_blob_close($blh);
|
||||||
}
|
}
|
||||||
else if($output->column_type[$name]!='number') {
|
else if($output->column_type[$name]=='number') {
|
||||||
//$value = "'".$value."'";
|
// 연산식이 들어갔을 경우 컬럼명이 있는 지 체크해 더블쿼터를 넣어줌
|
||||||
}
|
preg_match("/(?i)[a-z][a-z0-9_-]+/", $value, $matches);
|
||||||
elseif(!$value || is_numeric($value)) {
|
|
||||||
$value = (int)$value;
|
foreach($matches as $key => $val) {
|
||||||
|
$value = str_replace($val, "\"".$val."\"", $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($value) != 0) {
|
if($matches != null) {
|
||||||
$pos = strpos($value, '+');
|
|
||||||
if($pos == 0) $pos = strpos($value, '-');
|
|
||||||
if($pos == 0) $pos = strpos($value, '*');
|
|
||||||
if($pos == 0) {
|
|
||||||
$pos = strpos($value, '/');
|
|
||||||
if(substr_count($value, ".") > 1) $pos = 0; // value에 url주소가 들어가는경우
|
|
||||||
}
|
|
||||||
|
|
||||||
if($pos != 0) {
|
|
||||||
$substr = substr($value, 0, $pos);
|
|
||||||
$value = '"'.$substr.'"'.substr($value, $pos, strlen($value));
|
|
||||||
$column_list[] = sprintf("\"%s\" = %s", $name, $value);
|
$column_list[] = sprintf("\"%s\" = %s", $name, $value);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue