File tree Expand file tree Collapse file tree 5 files changed +6
-10
lines changed Expand file tree Collapse file tree 5 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ public function _dbLoadIfNotLoaded(): void
198198 $ sql = 'SELECT * FROM ' .$ connection ->quoteIdentifier ($ this ->dbTableName ).' WHERE ' .$ sql_where ;
199199 $ result = $ connection ->executeQuery ($ sql , $ parameters );
200200
201- $ row = $ result ->fetch (\ PDO :: FETCH_ASSOC );
201+ $ row = $ result ->fetchAssociative ( );
202202
203203 if ($ row === false ) {
204204 throw new TDBMException ("Could not retrieve object from table \"$ this ->dbTableName \" using filter \". $ sql_where. \" with data \"" .var_export ($ parameters , true )."\". " );
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ private function formatSelect(array $baseSelect): array
232232 }
233233
234234 $ table = $ this ->schema ->getTable ($ tableName );
235- $ pkColumns = $ table ->getPrimaryKeyColumns ();
235+ $ pkColumns = $ table ->getPrimaryKey ()-> getUnquotedColumns ();
236236 foreach ($ table ->getColumns () as $ column ) {
237237 $ columnName = $ column ->getName ();
238238 $ alias = AbstractQueryFactory::getColumnAlias ($ tableName , $ columnName );
@@ -252,7 +252,7 @@ private function formatSelect(array $baseSelect): array
252252 ]
253253 ];
254254 $ formattedSelect [] = $ astColumn ;
255- if (array_key_exists ($ columnName , $ pkColumns )) {
255+ if (in_array ($ columnName , $ pkColumns, true )) {
256256 $ formattedCountSelect [] = $ astColumn ;
257257 }
258258 $ columnDescriptors [$ alias ] = [
Original file line number Diff line number Diff line change 33namespace TheCodingMachine \TDBM \Performance ;
44
55use Doctrine \Common \Cache \ArrayCache ;
6- use Doctrine \Common \Cache \VoidCache ;
76use Doctrine \DBAL \Connection ;
87use Mouf \Database \SchemaAnalyzer \SchemaAnalyzer ;
98use PhpBench \Benchmark \Metadata \Annotations \Iterations ;
109use TheCodingMachine \FluidSchema \TdbmFluidSchema ;
1110use TheCodingMachine \TDBM \Configuration ;
1211use TheCodingMachine \TDBM \ConfigurationInterface ;
1312use TheCodingMachine \TDBM \ConnectionFactory ;
14- use TheCodingMachine \TDBM \DummyGeneratorListener ;
1513use TheCodingMachine \TDBM \SchemaLockFileDumper ;
1614use TheCodingMachine \TDBM \TDBMAbstractServiceTest ;
1715use TheCodingMachine \TDBM \TDBMSchemaAnalyzer ;
@@ -70,7 +68,7 @@ private static function initSchema(Connection $connection): void
7068 $ sqlStmts = $ toSchema ->getMigrateFromSql ($ fromSchema , $ connection ->getDatabasePlatform ());
7169
7270 foreach ($ sqlStmts as $ sqlStmt ) {
73- $ connection ->exec ($ sqlStmt );
71+ $ connection ->executeStatement ($ sqlStmt );
7472 }
7573
7674 for ($ i = 1 ; $ i < 200 ; $ i ++) {
Original file line number Diff line number Diff line change @@ -444,12 +444,12 @@ private static function initSchema(Connection $connection): void
444444
445445 foreach ($ sqlStmts as $ sqlStmt ) {
446446 //echo $sqlStmt."\n";
447- $ connection ->exec ($ sqlStmt );
447+ $ connection ->executeStatement ($ sqlStmt );
448448 }
449449
450450 // Let's generate computed columns
451451 if ($ connection ->getDatabasePlatform () instanceof MySqlPlatform && !self ::isMariaDb ($ connection )) {
452- $ connection ->exec ('CREATE TABLE `players` (
452+ $ connection ->executeStatement ('CREATE TABLE `players` (
453453 `id` INT UNSIGNED AUTO_INCREMENT NOT NULL,
454454 `player_and_games` JSON NOT NULL,
455455 `names_virtual` VARCHAR(20) GENERATED ALWAYS AS (`player_and_games` ->> \'$.name \') NOT NULL COMMENT \'@ReadOnly \',
Original file line number Diff line number Diff line change 2222
2323namespace TheCodingMachine \TDBM \Utils ;
2424
25- use Doctrine \Common \Cache \ArrayCache ;
2625use Doctrine \Common \Cache \VoidCache ;
2726use Doctrine \DBAL \Schema \Schema ;
2827use Doctrine \DBAL \Schema \Table ;
29- use Doctrine \DBAL \Types \Type ;
3028use Doctrine \DBAL \Types \Types ;
3129use Mouf \Database \SchemaAnalyzer \SchemaAnalyzer ;
3230use TheCodingMachine \TDBM \Configuration ;
You can’t perform that action at this time.
0 commit comments