MariaDB 10.5 adds a suffix on old datatypes
MariaDB when encountering an old datetime type will add a suffix of /* mariadb-5.3 */ on its schema information page. Xorm does not understand this and then its mappings fail. The simplest solution is just to remove any fixed suffix and that is what this PR does - a clever solution would look for and remove any comments or match them. See https://mariadb.com/kb/en/time/ for more details about the comment. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
40ee326cac
commit
dcfaed6a11
|
@ -353,6 +353,8 @@ func (db *mysql) GetColumns(queryer core.Queryer, ctx context.Context, tableName
|
|||
|
||||
cts := strings.Split(colType, "(")
|
||||
colName := cts[0]
|
||||
// Remove the /* mariadb-5.3 */ suffix from coltypes
|
||||
colName = strings.TrimSuffix(colName, "/* mariadb-5.3 */")
|
||||
colType = strings.ToUpper(colName)
|
||||
var len1, len2 int
|
||||
if len(cts) == 2 {
|
||||
|
|
Loading…
Reference in New Issue