@@ -2133,25 +2133,30 @@ func (s *testDBSuite) TestCheckColumnCantHaveDefaultValue(c *C) {
2133
2133
s .tk .MustExec ("set sql_mode='';" )
2134
2134
s .tk .MustExec ("drop table if exists text_default_text;" )
2135
2135
s .tk .MustExec ("create table text_default_text(c1 text not null default '');" )
2136
- ctx := s .tk .Se .(sessionctx.Context )
2137
- is := domain .GetDomain (ctx ).InfoSchema ()
2138
- tblInfo , err := is .TableByName (model .NewCIStr ("test" ), model .NewCIStr ("text_default_text" ))
2139
- c .Assert (err , IsNil )
2140
- c .Assert (tblInfo .Meta ().Columns [0 ].DefaultValue , Equals , "" )
2136
+ s .tk .MustQuery (`show create table text_default_text` ).Check (testutil .RowsWithSep ("|" ,
2137
+ "" +
2138
+ "text_default_text CREATE TABLE `text_default_text` (\n " +
2139
+ " `c1` text NOT NULL\n " +
2140
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin" ,
2141
+ ))
2141
2142
2142
2143
s .tk .MustExec ("drop table if exists text_default_blob;" )
2143
2144
s .tk .MustExec ("create table text_default_blob(c1 blob not null default '');" )
2144
- is = domain .GetDomain (ctx ).InfoSchema ()
2145
- tblInfo , err = is .TableByName (model .NewCIStr ("test" ), model .NewCIStr ("text_default_blob" ))
2146
- c .Assert (err , IsNil )
2147
- c .Assert (tblInfo .Meta ().Columns [0 ].DefaultValue , Equals , "" )
2145
+ s .tk .MustQuery (`show create table text_default_blob` ).Check (testutil .RowsWithSep ("|" ,
2146
+ "" +
2147
+ "text_default_blob CREATE TABLE `text_default_blob` (\n " +
2148
+ " `c1` blob NOT NULL\n " +
2149
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin" ,
2150
+ ))
2148
2151
2149
2152
s .tk .MustExec ("drop table if exists text_default_json;" )
2150
2153
s .tk .MustExec ("create table text_default_json(c1 json not null default '');" )
2151
- is = domain .GetDomain (ctx ).InfoSchema ()
2152
- tblInfo , err = is .TableByName (model .NewCIStr ("test" ), model .NewCIStr ("text_default_json" ))
2153
- c .Assert (err , IsNil )
2154
- c .Assert (tblInfo .Meta ().Columns [0 ].DefaultValue , Equals , `null` )
2154
+ s .tk .MustQuery (`show create table text_default_json` ).Check (testutil .RowsWithSep ("|" ,
2155
+ "" +
2156
+ "text_default_json CREATE TABLE `text_default_json` (\n " +
2157
+ " `c1` json NOT NULL DEFAULT 'null'\n " +
2158
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin" ,
2159
+ ))
2155
2160
}
2156
2161
2157
2162
func (s * testDBSuite ) TestCharacterSetInColumns (c * C ) {
0 commit comments