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

Merged
lunny merged 1 commits from jdkendall/xorm:mysql-dialect/orderby-clause-error into master 1 year ago
  1. 2
      dialects/mysql.go

2
dialects/mysql.go

@ -309,7 +309,7 @@ func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName @@ -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 {

Loading…
Cancel
Save