Commit 12f110d4 authored by Jérome Perrin's avatar Jérome Perrin

testTableStructureMigration: update test after mariadb 10.3.38

- use an explicit table level COLLATE because the default one now
appears in the SHOW CREATE TABLE.
- SHOW CREATE TABLE no longer have COLLATE on columns
parent 4872b949
...@@ -120,7 +120,7 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase): ...@@ -120,7 +120,7 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
dedent( dedent(
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL `a` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci""")) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
# insterting 1 will be casted as string # insterting 1 will be casted as string
self.query("INSERT INTO X VALUES (1)") self.query("INSERT INTO X VALUES (1)")
...@@ -147,12 +147,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase): ...@@ -147,12 +147,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` int(11) NOT NULL COMMENT 'old comment' `a` int(11) NOT NULL COMMENT 'old comment'
) ENGINE=InnoDB DEFAULT CHARSET=utf8"""), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent( dedent(
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` int(11) NOT NULL COMMENT 'new comment' `a` int(11) NOT NULL COMMENT 'new comment'
) ENGINE=InnoDB DEFAULT CHARSET=utf8""")) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.assertEqual( self.assertEqual(
('a', 'new comment'), ('a', 'new comment'),
self.query( self.query(
...@@ -209,7 +209,7 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase): ...@@ -209,7 +209,7 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\ """\
CREATE TABLE `table` ( CREATE TABLE `table` (
`and` int(11) DEFAULT NULL, `and` int(11) DEFAULT NULL,
`alter` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'BETWEEN', `alter` varchar(255) DEFAULT 'BETWEEN',
KEY `use` (`alter`) KEY `use` (`alter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
table_name='table') table_name='table')
...@@ -222,12 +222,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase): ...@@ -222,12 +222,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8"""), ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""),
dedent( dedent(
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8""")) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"""))
self.assertEqual( self.assertEqual(
('X', 'InnoDB'), ('X', 'InnoDB'),
self.query( self.query(
...@@ -245,12 +245,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase): ...@@ -245,12 +245,12 @@ class TestTableStructureMigrationTestCase(ERP5TypeTestCase):
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='old comment'"""), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='old comment'"""),
dedent( dedent(
"""\ """\
CREATE TABLE `X` ( CREATE TABLE `X` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='new comment'""")) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='new comment'"""))
self.assertEqual( self.assertEqual(
('X', 'new comment'), ('X', 'new comment'),
self.query( self.query(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment