Fix mysql dialect error from invalid db identifier in orderby clause (#1743) (#1751)

Fix mysql dialect error from invalid db identifier in orderby clause (#1743)

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1751
This commit is contained in:
jdkendall 2020-08-31 01:19:12 +00:00 committed by Lunny Xiao
parent f39a4cb41c
commit 76d6b9fdf5
1 changed files with 1 additions and 1 deletions

View File

@ -309,7 +309,7 @@ func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
args := []interface{}{db.uri.DBName, tableName}
s := "SELECT `COLUMN_NAME`, `IS_NULLABLE`, `COLUMN_DEFAULT`, `COLUMN_TYPE`," +
" `COLUMN_KEY`, `EXTRA`,`COLUMN_COMMENT` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = ? AND `TABLE_NAME` = ?" +
" ORDER BY `INFORMATION_SCHEMA`.`COLUMNS`.ORDINAL_POSITION"
" ORDER BY `COLUMNS`.ORDINAL_POSITION"
rows, err := queryer.QueryContext(ctx, s, args...)
if err != nil {