mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Convert all SQL keywords to upper case
대소문자를 섞어서 쓰고 있던 SQL 키워드들을 모두 대문자로 통일 as, and, or, like, desc 등이 소문자였음
This commit is contained in:
parent
6070707941
commit
83362034cd
6 changed files with 15 additions and 20 deletions
|
|
@ -46,7 +46,7 @@ class Condition
|
|||
$this->column_name = $column_name;
|
||||
$this->argument = $argument;
|
||||
$this->operation = $operation;
|
||||
$this->pipe = $pipe;
|
||||
$this->pipe = strtoupper($pipe);
|
||||
}
|
||||
|
||||
function getArgument()
|
||||
|
|
@ -208,32 +208,27 @@ class Condition
|
|||
case 'like_tail' :
|
||||
case 'like_prefix' :
|
||||
case 'like' :
|
||||
if(defined('__CUBRID_VERSION__')
|
||||
&& __CUBRID_VERSION__ >= '8.4.1')
|
||||
return $name . ' rlike ' . $value;
|
||||
else
|
||||
return $name . ' like ' . $value;
|
||||
break;
|
||||
return $name . ' LIKE ' . $value;
|
||||
case 'notlike_tail' :
|
||||
case 'notlike_prefix' :
|
||||
case 'notlike' :
|
||||
return $name . ' not like ' . $value;
|
||||
return $name . ' NOT LIKE ' . $value;
|
||||
break;
|
||||
case 'in' :
|
||||
return $name . ' in ' . $value;
|
||||
return $name . ' IN ' . $value;
|
||||
break;
|
||||
case 'notin' :
|
||||
case 'not_in' :
|
||||
return $name . ' not in ' . $value;
|
||||
return $name . ' NOT IN ' . $value;
|
||||
break;
|
||||
case 'notequal' :
|
||||
return $name . ' <> ' . $value;
|
||||
break;
|
||||
case 'notnull' :
|
||||
return $name . ' is not null';
|
||||
return $name . ' IS NOT NULL ';
|
||||
break;
|
||||
case 'null' :
|
||||
return $name . ' is null';
|
||||
return $name . ' IS NULL ';
|
||||
break;
|
||||
case 'and' :
|
||||
return $name . ' & ' . $value;
|
||||
|
|
@ -248,7 +243,7 @@ class Condition
|
|||
return $name . ' ~ ' . $value;
|
||||
break;
|
||||
case 'between' :
|
||||
return $name . ' between ' . $value[0] . ' and ' . $value[1];
|
||||
return $name . ' BETWEEN ' . $value[0] . ' AND ' . $value[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class ConditionWithArgument extends Condition
|
|||
$q = '?';
|
||||
}
|
||||
}
|
||||
return $this->pipe . ' ' . $this->getConditionPart($q);
|
||||
return strtoupper($this->pipe) . ' ' . $this->getConditionPart($q);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class SelectExpression extends Expression
|
|||
*/
|
||||
function getExpression()
|
||||
{
|
||||
return sprintf("%s%s", $this->column_name, $this->column_alias ? " as " . $this->column_alias : "");
|
||||
return sprintf("%s%s", $this->column_name, $this->column_alias ? (' AS ' . $this->column_alias) : "");
|
||||
}
|
||||
|
||||
function show()
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class OrderByColumn
|
|||
{
|
||||
$result = $this->getColumnName();
|
||||
$result .= ' ';
|
||||
$result .= is_a($this->sort_order, 'Argument') ? $this->sort_order->getValue() : $this->sort_order;
|
||||
$result .= is_a($this->sort_order, 'Argument') ? $this->sort_order->getValue() : strtoupper($this->sort_order);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ class JoinTable extends Table
|
|||
|
||||
function toString($with_value = true)
|
||||
{
|
||||
$part = $this->join_type . ' ' . $this->name;
|
||||
$part .= $this->alias ? ' as ' . $this->alias : '';
|
||||
$part .= ' on ';
|
||||
$part = strtoupper($this->join_type) . ' ' . $this->name;
|
||||
$part .= $this->alias ? (' AS ' . $this->alias) : '';
|
||||
$part .= ' ON ';
|
||||
foreach($this->conditions as $conditionGroup)
|
||||
{
|
||||
$part .= $conditionGroup->toString($with_value);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class Table
|
|||
function toString()
|
||||
{
|
||||
//return $this->name;
|
||||
return sprintf("%s%s", $this->name, $this->alias ? ' as ' . $this->alias : '');
|
||||
return sprintf("%s%s", $this->name, $this->alias ? (' AS ' . $this->alias) : '');
|
||||
}
|
||||
|
||||
function getName()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue