mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 23:42:11 +00:00
check if temp table ttcontentid exists in sql statement
This commit is contained in:
parent
d9aaad16d3
commit
f976bf0e83
|
@ -412,7 +412,7 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
else if (!strcasecmp($tableName, "ttcontentid")) {
|
||||
switch($this->_driver) {
|
||||
case 'sqlite':
|
||||
$queryStr = "CREATE TEMPORARY TABLE `ttcontentid` AS ".
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttcontentid` AS ".
|
||||
"SELECT `tblDocumentContent`.`document` AS `document`, ".
|
||||
"MAX(`tblDocumentContent`.`version`) AS `maxVersion` ".
|
||||
"FROM `tblDocumentContent` ".
|
||||
|
@ -420,7 +420,7 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
"ORDER BY `tblDocumentContent`.`document`";
|
||||
break;
|
||||
default:
|
||||
$queryStr = "CREATE TEMPORARY TABLE `ttcontentid` (PRIMARY KEY (`document`), INDEX (`maxVersion`)) ".
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttcontentid` (PRIMARY KEY (`document`), INDEX (`maxVersion`)) ".
|
||||
"SELECT `tblDocumentContent`.`document`, ".
|
||||
"MAX(`tblDocumentContent`.`version`) AS `maxVersion` ".
|
||||
"FROM `tblDocumentContent` ".
|
||||
|
|
Loading…
Reference in New Issue
Block a user