#394 큐브리드 모듈의 페이징 버그 오류 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3617 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
rokmcssu 2008-01-29 07:04:39 +00:00
parent de22e50d5a
commit 8151402ad5

View file

@ -423,21 +423,21 @@
$name = $val['name'];
$value = $val['value'];
if($this->getColumnType($output->column_type,$name)!='number') {
$clen=strlen($value);
if ($clen <= $this->cutlen)
$value = "'".$this->addQuotes($value)."'";
else {
$wrk="";
$off=0;
while ($off<$clen) {
$wlen=$clen-$off;
if ($wlen>$this->cutlen) $wlen=$this->cutlen;
if ($off>0) $wrk .= "+\n";
$wrk .= "'".$this->addQuotes(substr($value, $off, $wlen))."'";
$off += $wlen;
}
$value = $wrk;
}
$clen=strlen($value);
if ($clen <= $this->cutlen)
$value = "'".$this->addQuotes($value)."'";
else {
$wrk="";
$off=0;
while ($off<$clen) {
$wlen=$clen-$off;
if ($wlen>$this->cutlen) $wlen=$this->cutlen;
if ($off>0) $wrk .= "+\n";
$wrk .= "'".$this->addQuotes(substr($value, $off, $wlen))."'";
$off += $wlen;
}
$value = $wrk;
}
if(!$value) $value = 'null';
} elseif(!$value || is_numeric($value)) $value = (int)$value;
@ -467,21 +467,21 @@
if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value;
else {
if($output->column_type[$name]!='number') {
$clen=strlen($value);
if ($clen <= $this->cutlen)
$value = "'".$this->addQuotes($value)."'";
else {
$wrk="";
$off=0;
while ($off<$clen) {
$wlen=$clen-$off;
if ($wlen>$this->cutlen) $wlen=$this->cutlen;
if ($off>0) $wrk .= "+\n";
$wrk .= "'".$this->addQuotes(substr($value, $off, $wlen))."'";
$off += $wlen;
}
$value = $wrk;
}
$clen=strlen($value);
if ($clen <= $this->cutlen)
$value = "'".$this->addQuotes($value)."'";
else {
$wrk="";
$off=0;
while ($off<$clen) {
$wlen=$clen-$off;
if ($wlen>$this->cutlen) $wlen=$this->cutlen;
if ($off>0) $wrk .= "+\n";
$wrk .= "'".$this->addQuotes(substr($value, $off, $wlen))."'";
$off += $wlen;
}
$value = $wrk;
}
}
elseif(!$value || is_numeric($value)) $value = (int)$value;
@ -573,16 +573,16 @@
$index_list[] = sprintf('%s %s', $val[0], $val[1]);
}
if(count($index_list)) $query .= ' order by '.implode(',',$index_list);
$query = sprintf('%s for orderby_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s for orderby_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
}
else {
if (count($output->groups))
$query = sprintf('%s having groupby_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s having groupby_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
else {
if ($condition)
$query = sprintf('%s and inst_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s and inst_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
else
$query = sprintf('%s where inst_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s where inst_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
}
}
@ -609,53 +609,53 @@
/**
* @brief 현재 시점의 Stack trace를 보여줌.결과를 fetch
**/
function backtrace()
{
$output = "<div style='text-align: left;'>\n";
$output .= "<b>Backtrace:</b><br />\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 .= "<br />\n";
$output .= "<b>file:</b> {$bt['line']} - {$bt['file']}<br />\n";
$output .= "<b>call:</b> {$bt['class']}{$bt['type']}{$bt['function']}($args)<br />\n";
}
$output .= "</div>\n";
return $output;
}
function backtrace()
{
$output = "<div style='text-align: left;'>\n";
$output .= "<b>Backtrace:</b><br />\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 .= "<br />\n";
$output .= "<b>file:</b> {$bt['line']} - {$bt['file']}<br />\n";
$output .= "<b>call:</b> {$bt['class']}{$bt['type']}{$bt['function']}($args)<br />\n";
}
$output .= "</div>\n";
return $output;
}
/**
@ -696,16 +696,16 @@
$index_list[] = sprintf('%s %s', $val[0], $val[1]);
}
if(count($index_list)) $query .= ' order by '.implode(',',$index_list);
$query = sprintf('%s for orderby_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s for orderby_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
}
else {
if (count($output->groups))
$query = sprintf('%s having groupby_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s having groupby_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
else {
if ($condition)
$query = sprintf('%s and inst_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s and inst_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
else
$query = sprintf('%s where inst_num() between %d and %d', $query, $start_count, $list_count);
$query = sprintf('%s where inst_num() between %d and %d', $query, $start_count + 1, $list_count + $start_count);
}
}