mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
MySQL DB에서 특정 테이블의 index체크시 서버 버전에 따라 where 절이 먹히지 않아서 전체 목록을 가져와 하나씩 비교하는 방식으로 구현방법 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2421 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a6358e6e95
commit
f06a43f148
2 changed files with 14 additions and 6 deletions
|
|
@ -260,12 +260,16 @@
|
||||||
* @brief 특정 테이블의 index 정보를 return
|
* @brief 특정 테이블의 index 정보를 return
|
||||||
**/
|
**/
|
||||||
function isIndexExists($table_name, $index_name) {
|
function isIndexExists($table_name, $index_name) {
|
||||||
$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
|
//$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
|
||||||
|
$query = sprintf("show indexes from %s%s", $this->prefix, $table_name);
|
||||||
$result = $this->_query($query);
|
$result = $this->_query($query);
|
||||||
if($this->isError()) return;
|
if($this->isError()) return;
|
||||||
$output = $this->_fetch($result);
|
$output = $this->_fetch($result);
|
||||||
if(!$output) return false;
|
|
||||||
return true;
|
for($i=0;$i<count($output);$i++) {
|
||||||
|
if($output[$i]->Key_name == $index_name) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -269,12 +269,16 @@
|
||||||
* @brief 특정 테이블의 index 정보를 return
|
* @brief 특정 테이블의 index 정보를 return
|
||||||
**/
|
**/
|
||||||
function isIndexExists($table_name, $index_name) {
|
function isIndexExists($table_name, $index_name) {
|
||||||
$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
|
//$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
|
||||||
|
$query = sprintf("show indexes from %s%s", $this->prefix, $table_name);
|
||||||
$result = $this->_query($query);
|
$result = $this->_query($query);
|
||||||
if($this->isError()) return;
|
if($this->isError()) return;
|
||||||
$output = $this->_fetch($result);
|
$output = $this->_fetch($result);
|
||||||
if(!$output) return false;
|
|
||||||
return true;
|
for($i=0;$i<count($output);$i++) {
|
||||||
|
if($output[$i]->Key_name == $index_name) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue