File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
lib/Varien/Db/Adapter/Pdo Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2630,7 +2630,22 @@ public function truncateTable($tableName, $schemaName = null)
2630
2630
*/
2631
2631
public function isTableExists ($ tableName , $ schemaName = null )
2632
2632
{
2633
- return $ this ->showTableStatus ($ tableName , $ schemaName ) !== false ;
2633
+ $ fromDbName = 'DATABASE() ' ;
2634
+ if ($ schemaName !== null ) {
2635
+ $ fromDbName = $ this ->quote ($ schemaName );
2636
+ }
2637
+
2638
+ $ sql = sprintf (
2639
+ 'SELECT COUNT(1) AS tbl_exists FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = %s AND TABLE_SCHEMA = %s ' ,
2640
+ $ this ->quote ($ tableName ),
2641
+ $ fromDbName
2642
+ );
2643
+ $ ddl = $ this ->rawFetchRow ($ sql , 'tbl_exists ' );
2644
+ if ($ ddl ) {
2645
+ return true ;
2646
+ }
2647
+
2648
+ return false ;
2634
2649
}
2635
2650
2636
2651
/**
You can’t perform that action at this time.
0 commit comments