Skip to content

Commit ad5a6f2

Browse files
authored
Merge pull request #58 from wave-framework/mysql-column-order
Ensure the column order provided by the MySQL driver is consistently p…
2 parents 1fafde9 + 56321ae commit ad5a6f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Wave/DB/Driver/MySQL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function getColumns(DB\Table $table)
8484
self::$_column_cache[$namespace] = array();
8585

8686
$column_sql = 'SELECT TABLE_NAME, COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, COLUMN_TYPE, EXTRA, COLUMN_COMMENT ' .
87-
'FROM `information_schema`.`COLUMNS` WHERE `TABLE_SCHEMA` = ?;';
87+
'FROM `information_schema`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? ORDER BY `TABLE_NAME`, ORDINAL_POSITION;';
8888

8989
$column_stmt = $table->getDatabase()->getConnection()->prepare($column_sql);
9090
$column_stmt->execute(array($table->getDatabase()->getName()));

0 commit comments

Comments
 (0)