@@ -135,11 +135,11 @@ class Mysql extends \Zend_Db_Adapter_Pdo_Mysql implements AdapterInterface
135
135
protected $ _isDdlCacheAllowed = true ;
136
136
137
137
/**
138
- * MySQL version(MySQL-8, MySQL-5.7, MariaDB)
138
+ * Save if mysql engine is 8 or not.
139
139
*
140
- * @var string
140
+ * @var bool
141
141
*/
142
- private $ dbVersion ;
142
+ private $ isMysql8Engine ;
143
143
144
144
/**
145
145
* MySQL column - Table DDL type pairs
@@ -1196,7 +1196,7 @@ public function showTableStatus($tableName, $schemaName = null)
1196
1196
}
1197
1197
$ query = sprintf ('SHOW TABLE STATUS%s LIKE %s ' , $ fromDbName , $ this ->quote ($ tableName ));
1198
1198
//checks which slq engine used
1199
- if (!preg_match ( ' /^(8\.)/ ' , $ this ->isMysql8EngineUsed () )) {
1199
+ if (!$ this ->isMysql8EngineUsed ()) {
1200
1200
//if it's not MySQl-8 we just fetch results
1201
1201
return $ this ->rawFetchRow ($ query );
1202
1202
}
@@ -1209,17 +1209,18 @@ public function showTableStatus($tableName, $schemaName = null)
1209
1209
}
1210
1210
1211
1211
/**
1212
- * Get database version.
1212
+ * Checks if the engine is mysql 8
1213
1213
*
1214
- * @return string
1214
+ * @return bool
1215
1215
*/
1216
- private function isMysql8EngineUsed (): string
1216
+ private function isMysql8EngineUsed (): bool
1217
1217
{
1218
- if (!$ this ->dbVersion ) {
1219
- $ this ->dbVersion = $ this ->fetchPairs ("SHOW variables LIKE 'version' " )['version ' ];
1218
+ if (!$ this ->isMysql8Engine ) {
1219
+ $ version = $ this ->fetchPairs ("SHOW variables LIKE 'version' " )['version ' ];
1220
+ $ this ->isMysql8Engine = (bool ) preg_match ('/^(8\.)/ ' , $ version );
1220
1221
}
1221
1222
1222
- return $ this ->dbVersion ;
1223
+ return $ this ->isMysql8Engine ;
1223
1224
}
1224
1225
1225
1226
/**
0 commit comments