tidy up appearance of the alreadyQuoted SQL string
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
cd10389e15
commit
e50415a956
|
@ -307,12 +307,12 @@ func (db *mysql) AddColumnSQL(tableName string, col *schemas.Column) string {
|
||||||
|
|
||||||
func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName string) ([]string, map[string]*schemas.Column, error) {
|
func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName string) ([]string, map[string]*schemas.Column, error) {
|
||||||
args := []interface{}{db.uri.DBName, tableName}
|
args := []interface{}{db.uri.DBName, tableName}
|
||||||
alreadyQuoted := `(INSTR(VERSION(), 'maria') > 0 &&
|
alreadyQuoted := "(INSTR(VERSION(), 'maria') > 0 && " +
|
||||||
(SUBSTRING_INDEX(VERSION(), '.', 1) > 10 ||
|
"(SUBSTRING_INDEX(VERSION(), '.', 1) > 10 || " +
|
||||||
(SUBSTRING_INDEX(VERSION(), '.', 1) = 10 &&
|
"(SUBSTRING_INDEX(VERSION(), '.', 1) = 10 && " +
|
||||||
(SUBSTRING_INDEX(SUBSTRING(VERSION(), 4), '.', 1) > 2 ||
|
"(SUBSTRING_INDEX(SUBSTRING(VERSION(), 4), '.', 1) > 2 || " +
|
||||||
(SUBSTRING_INDEX(SUBSTRING(VERSION(), 4), '.', 1) = 2 &&
|
"(SUBSTRING_INDEX(SUBSTRING(VERSION(), 4), '.', 1) = 2 && " +
|
||||||
SUBSTRING_INDEX(SUBSTRING(VERSION(), 6), '-', 1) >= 7)))))`
|
"SUBSTRING_INDEX(SUBSTRING(VERSION(), 6), '-', 1) >= 7)))))"
|
||||||
s := "SELECT `COLUMN_NAME`, `IS_NULLABLE`, `COLUMN_DEFAULT`, `COLUMN_TYPE`," +
|
s := "SELECT `COLUMN_NAME`, `IS_NULLABLE`, `COLUMN_DEFAULT`, `COLUMN_TYPE`," +
|
||||||
" `COLUMN_KEY`, `EXTRA`, `COLUMN_COMMENT`, " +
|
" `COLUMN_KEY`, `EXTRA`, `COLUMN_COMMENT`, " +
|
||||||
alreadyQuoted + " AS NEEDS_QUOTE " +
|
alreadyQuoted + " AS NEEDS_QUOTE " +
|
||||||
|
|
Loading…
Reference in New Issue