Commit 192678e7 authored by Michael Widenius's avatar Michael Widenius

MDEV-5241: Collation incompatibilities with MySQL-5.6

- Character set code & tests from Alexander Barkov
- Integration with ALTER TABLE, REPAIR and open_table from Monty

The problem was that MySQL 5.6 added some croatian and vitanamese character set collations that are incompatible with MariaDB.

The fix is to move the MariaDB conflicting collation numbers out of the region that MySQL is likely to use.
mysql_upgrade, REPAIR TABLE or ALTER TABLE will fix the collations.
If one tries to access and old incompatible table, one will get the error "Table upgrade required...."
After this patch, MariaDB supports all the MySQL character set collations and the old MariaDB croatian collations, which are closer to the latest standard than the MySQL versions.

New character sets:
ucs2_croatian_mysql561_uca_ci
utf8_croatian_mysql561_uca_ci
utf16_croatian_mysql561_uca_ci
utf32_croatian_mysql561_uca_ci
utf8mb4_croatian_mysql561_uca_ci

Other things:
- Fixed some compiler warnings
- mysql_upgrade prints information about repaired tables.
- Increased version number

VERSION:
  Increased VERSION number
client/mysqlcheck.c:
  Print repaired table name when using --verbose
include/m_ctype.h:
  Add new MariaDB collation regions that are not likely to conflict with MySQL
include/my_base.h:
  Added flag to detect if table was opened for ALTER TABLE
mysql-test/r/ctype_ldml.result:
  Updated result
mysql-test/r/ctype_uca.result:
  Updated result
mysql-test/r/ctype_upgrade.result:
  Updated result
mysql-test/r/ctype_utf16_uca.result:
  Updated result
mysql-test/r/ctype_utf32_uca.result:
  Updated result
mysql-test/r/ctype_utf8mb4_uca.result:
  Updated result
mysql-test/std_data/ctype_upgrade:
  Test files for testing upgrading of conflicting collations
mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result:
  New collations added
mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result:
  New collations added
mysql-test/suite/innodb/r/innodb_ctype_ldml.result:
  Updated test result
mysql-test/suite/innodb/t/innodb_ctype_ldml.test:
  Updated test result
mysql-test/suite/plugins/r/show_all_plugins.result:
  Updated version number
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result:
  Updated version number
mysql-test/t/ctype_ldml.test:
  Updated test
mysql-test/t/ctype_uca.test:
  Testing of new collations
mysql-test/t/ctype_upgrade.test:
  Testing of upgrading tables with old collations
  The test ensures that:
  - We will get an error if we try to open a table with old collations.
  - CHECK TABLE will detect that the table needs to be upgraded.
  - ALTER TABLE and REPAIR will fix the table.
  - mysql_upgrade works as expected
mysql-test/t/ctype_utf16_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf32_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf8mb4_uca.test:
  Testing of new collations
mysys/charset-def.c:
  Added new character sets
mysys/charset.c:
  Always give an error, if requested, if a character set didn't exist
sql/handler.cc:
  - Added upgrade_collation() to check if collation is compatible with old version
  - check_collation_compatibility() checks if we are using an old collation from MariaDB 5.5 or MySQL 5.6
  - ha_check_for_upgrade() returns HA_ADMIN_NEEDS_ALTER if we have an incompatible collation
sql/handler.h:
  Added new prototypes
sql/sql_table.cc:
  - Mark that tables are opened for ALTER TABLE
  - If table needs to be upgraded, ensure we are not using online alter table.
sql/table.cc:
  - If we are using an old incompatible collation, change to use the new one and mark table as incompatible.
  - Give an error if we try to open an incompatible table.
sql/table.h:
  Added error that table needs to be rebuild
storage/connect/ha_connect.cc:
  Fixed compiler warning
strings/ctype-uca.c:
  New character sets
parent 273bcb92
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
# #
MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0 MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=5 MYSQL_VERSION_PATCH=6
MYSQL_VERSION_EXTRA= MYSQL_VERSION_EXTRA=
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.7.1" #define CHECK_VERSION "2.7.2"
#include "client_priv.h" #include "client_priv.h"
#include <m_ctype.h> #include <m_ctype.h>
...@@ -681,6 +681,8 @@ static int rebuild_table(char *name) ...@@ -681,6 +681,8 @@ static int rebuild_table(char *name)
fprintf(stderr, "Error: %s\n", mysql_error(sock)); fprintf(stderr, "Error: %s\n", mysql_error(sock));
rc= 1; rc= 1;
} }
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "FIXED");
my_free(query); my_free(query);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
......
...@@ -240,6 +240,32 @@ extern MY_UNI_CTYPE my_uni_ctype[256]; ...@@ -240,6 +240,32 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */ #define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */
#define MY_STRXFRM_REVERSE_SHIFT 16 #define MY_STRXFRM_REVERSE_SHIFT 16
/*
Collation IDs for MariaDB that should not conflict with MySQL.
We reserve 256..511, because MySQL will most likely use this range
when the range 0..255 is full.
We use the next 256 IDs starting from 512 and divide
them into 8 chunks, 32 collations each, as follows:
512 + (0..31) for single byte collations (e.g. latin9)
512 + (32..63) reserved (e.g. for utf32le, or more single byte collations)
512 + (64..95) for utf8
512 + (96..127) for utf8mb4
512 + (128..159) for ucs2
512 + (160..192) for utf16
512 + (192..223) for utf16le
512 + (224..255) for utf32
*/
#define MY_PAGE2_COLLATION_ID_8BIT 0x200
#define MY_PAGE2_COLLATION_ID_RESERVED 0x220
#define MY_PAGE2_COLLATION_ID_UTF8 0x240
#define MY_PAGE2_COLLATION_ID_UTF8MB4 0x260
#define MY_PAGE2_COLLATION_ID_UCS2 0x280
#define MY_PAGE2_COLLATION_ID_UTF16 0x2A0
#define MY_PAGE2_COLLATION_ID_UTF16LE 0x2C0
#define MY_PAGE2_COLLATION_ID_UTF32 0x2E0
struct my_uni_idx_st struct my_uni_idx_st
{ {
uint16 from; uint16 from;
......
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
#define HA_OPEN_INTERNAL_TABLE 512 #define HA_OPEN_INTERNAL_TABLE 512
#define HA_OPEN_NO_PSI_CALL 1024 /* Don't call/connect PSI */ #define HA_OPEN_NO_PSI_CALL 1024 /* Don't call/connect PSI */
#define HA_OPEN_MERGE_TABLE 2048 #define HA_OPEN_MERGE_TABLE 2048
/*
Allow opening even if table is incompatible as this is for ALTER TABLE which
will fix the table structure.
*/
#define HA_OPEN_FOR_ALTER 4096
/* The following is parameter to ha_rkey() how to use key */ /* The following is parameter to ha_rkey() how to use key */
......
...@@ -2168,6 +2168,116 @@ Z,z,Ź,ź,Ż,ż,Ž,ž ...@@ -2168,6 +2168,116 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
ǁ ǁ
ǂ ǂ
ǃ ǃ
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_mysql561_ci;
group_concat(c1 order by c1)
÷
×
A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ
AA,Aa,aA,aa
AE,Ae,aE,ae
Æ,æ,Ǣ,ǣ,Ǽ,ǽ
B,b
ƀ
Ɓ
Ƃ,ƃ
C,c,Ç,ç,Ĉ,ĉ,Ċ,ċ
CH,Ch,cH,ch
Č,č
Ć,ć
Ƈ,ƈ
D,d,Ď,ď
DZ,Dz,dZ,dz,DZ,Dz,dz
DŽ,Dž,dŽ,dž,DŽ,Dž,dž
Đ,đ
Ɖ
Ɗ
Ƌ,ƌ
Ð,ð
E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ
Ǝ,ǝ
Ə
Ɛ
F,f
Ƒ,ƒ
G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ
Ǥ,ǥ
Ɠ
Ɣ
Ƣ,ƣ
H,h,Ĥ,ĥ
ƕ,Ƕ
Ħ,ħ
I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị
IJ,Ij,iJ,ij,IJ,ij
ı
Ɨ
Ɩ
J,j,Ĵ,ĵ,ǰ
K,k,Ķ,ķ,Ǩ,ǩ
Ƙ,ƙ
L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
Ŀ,ŀ
LL,Ll,lL,ll
LJ,Lj,lJ,lj,LJ,Lj,lj
Ł,ł
ƚ
ƛ
M,m
N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
NJ,Nj,nJ,nj,NJ,Nj,nj
Ɲ
ƞ
Ŋ,ŋ
O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ
OE,Oe,oE,oe,Œ,œ
Ø,ø,Ǿ,ǿ
Ɔ
Ɵ
P,p
Ƥ,ƥ
Q,q
ĸ
R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
RR,Rr,rR,rr
Ʀ
S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ
SS,Ss,sS,ss,ß
Š,š
Ʃ
ƪ
T,t,Ţ,ţ,Ť,ť
ƾ
Ŧ,ŧ
ƫ
Ƭ,ƭ
Ʈ
U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự
Ɯ
Ʊ
V,v
Ʋ
W,w,Ŵ,ŵ
X,x
Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ
Ƴ,ƴ
Z,z,Ź,ź,Ż,ż
ƍ
Ž,ž
Ƶ,ƶ
Ʒ,Ǯ,ǯ
Ƹ,ƹ
ƺ
Þ,þ
ƿ,Ƿ
ƻ
Ƨ,ƨ
Ƽ,ƽ
Ƅ,ƅ
ʼn
ǀ
ǁ
ǂ
ǃ
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci;
group_concat(c1 order by c1) group_concat(c1 order by c1)
÷ ÷
...@@ -4367,6 +4477,116 @@ Z,z,Ź,ź,Ż,ż,Ž,ž ...@@ -4367,6 +4477,116 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
ǁ ǁ
ǂ ǂ
ǃ ǃ
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_mysql561_ci;
GROUP_CONCAT(c1 ORDER BY c1)
÷
×
A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ
AA,Aa,aA,aa
AE,Ae,aE,ae
Æ,æ,Ǣ,ǣ,Ǽ,ǽ
B,b
ƀ
Ɓ
Ƃ,ƃ
C,c,Ç,ç,Ĉ,ĉ,Ċ,ċ
CH,Ch,cH,ch
Č,č
Ć,ć
Ƈ,ƈ
D,d,Ď,ď
DZ,Dz,dZ,dz,DZ,Dz,dz
DŽ,Dž,dŽ,dž,DŽ,Dž,dž
Đ,đ
Ɖ
Ɗ
Ƌ,ƌ
Ð,ð
E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ
Ǝ,ǝ
Ə
Ɛ
F,f
Ƒ,ƒ
G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ
Ǥ,ǥ
Ɠ
Ɣ
Ƣ,ƣ
H,h,Ĥ,ĥ
ƕ,Ƕ
Ħ,ħ
I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị
IJ,Ij,iJ,ij,IJ,ij
ı
Ɨ
Ɩ
J,j,Ĵ,ĵ,ǰ
K,k,Ķ,ķ,Ǩ,ǩ
Ƙ,ƙ
L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
Ŀ,ŀ
LL,Ll,lL,ll
LJ,Lj,lJ,lj,LJ,Lj,lj
Ł,ł
ƚ
ƛ
M,m
N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
NJ,Nj,nJ,nj,NJ,Nj,nj
Ɲ
ƞ
Ŋ,ŋ
O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ
OE,Oe,oE,oe,Œ,œ
Ø,ø,Ǿ,ǿ
Ɔ
Ɵ
P,p
Ƥ,ƥ
Q,q
ĸ
R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
RR,Rr,rR,rr
Ʀ
S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ
SS,Ss,sS,ss,ß
Š,š
Ʃ
ƪ
T,t,Ţ,ţ,Ť,ť
ƾ
Ŧ,ŧ
ƫ
Ƭ,ƭ
Ʈ
U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự
Ɯ
Ʊ
V,v
Ʋ
W,w,Ŵ,ŵ
X,x
Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ
Ƴ,ƴ
Z,z,Ź,ź,Ż,ż
ƍ
Ž,ž
Ƶ,ƶ
Ʒ,Ǯ,ǯ
Ƹ,ƹ
ƺ
Þ,þ
ƿ,Ƿ
ƻ
Ƨ,ƨ
Ƽ,ƽ
Ƅ,ƅ
ʼn
ǀ
ǁ
ǂ
ǃ
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_ci;
GROUP_CONCAT(c1 ORDER BY c1) GROUP_CONCAT(c1 ORDER BY c1)
÷ ÷
...@@ -5661,7 +5881,7 @@ HEX(s1) ...@@ -5661,7 +5881,7 @@ HEX(s1)
0061000000000000000000000009 0061000000000000000000000009
0061 0061
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int, c1 varchar(200) collate utf8_croatian_ci, key (c1)); create table t1 (a int, c1 varchar(200) collate utf8_croatian_mysql561_ci, key (c1));
insert into t1 values (1,'=> DZ'),(2,'=> Dz'),(3,'=> dz'),(4,'=> dZ'); insert into t1 values (1,'=> DZ'),(2,'=> Dz'),(3,'=> dz'),(4,'=> dZ');
insert into t1 values (5,'=> DŽ'),(6,'=> Dž'),(7,'=> dž'),(8,'=> dŽ'); insert into t1 values (5,'=> DŽ'),(6,'=> Dž'),(7,'=> dž'),(8,'=> dŽ');
insert into t1 values (9,'=> dž'),(10,'=> DŽ'); insert into t1 values (9,'=> dž'),(10,'=> DŽ');
...@@ -5671,10 +5891,10 @@ c1 ...@@ -5671,10 +5891,10 @@ c1
=> Dz => Dz
=> dz => dz
=> dZ => dZ
=> dŽ
=> DŽ => DŽ
=> Dž => Dž
=> dž => dž
=> dŽ
=> dž => dž
=> DŽ => DŽ
select concat(c1) from t1 order by c1; select concat(c1) from t1 order by c1;
...@@ -5683,10 +5903,10 @@ concat(c1) ...@@ -5683,10 +5903,10 @@ concat(c1)
=> Dz => Dz
=> dz => dz
=> dZ => dZ
=> dŽ
=> DŽ => DŽ
=> Dž => Dž
=> dž => dž
=> dŽ
=> dž => dž
=> DŽ => DŽ
select * from t1 where c1 like '=> d%'; select * from t1 where c1 like '=> d%';
...@@ -5738,6 +5958,7 @@ a c1 ...@@ -5738,6 +5958,7 @@ a c1
5 => DŽ 5 => DŽ
6 => Dž 6 => Dž
7 => dž 7 => dž
8 => dŽ
9 => dž 9 => dž
10 => DŽ 10 => DŽ
select * from t1 where concat(c1) = '=> dž'; select * from t1 where concat(c1) = '=> dž';
...@@ -5745,6 +5966,7 @@ a c1 ...@@ -5745,6 +5966,7 @@ a c1
5 => DŽ 5 => DŽ
6 => Dž 6 => Dž
7 => dž 7 => dž
8 => dŽ
9 => dž 9 => dž
10 => DŽ 10 => DŽ
drop table t1; drop table t1;
......
This diff is collapsed.
...@@ -2177,6 +2177,116 @@ ZzŹźŻżŽž ...@@ -2177,6 +2177,116 @@ ZzŹźŻżŽž
ǁ ǁ
ǂ ǂ
ǃ ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_mysql561_ci;
group_concat(c1 order by binary c1 separator '')
÷
×
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ
AAAaaAaa
AEAeaEae
ÆæǢǣǼǽ
Bb
ƀ
Ɓ
Ƃƃ
CcÇçĈĉĊċ
CHChcHch
Čč
Ćć
Ƈƈ
DdĎď
DZDzdZdzDZDzdz
DŽDždŽdžDŽDždž
Đđ
Ɖ
Ɗ
Ƌƌ
Ðð
EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ
Ǝǝ
Ə
Ɛ
Ff
Ƒƒ
GgĜĝĞğĠġĢģǦǧǴǵ
Ǥǥ
Ɠ
Ɣ
Ƣƣ
HhĤĥ
ƕǶ
Ħħ
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị
IJIjiJijIJij
ı
Ɨ
Ɩ
JjĴĵǰ
KkĶķǨǩ
Ƙƙ
LlĹĺĻļĽľ
Ŀŀ
LLLllLll
LJLjlJljLJLjlj
Łł
ƚ
ƛ
Mm
NnÑñŃńŅņŇňǸǹ
NJNjnJnjNJNjnj
Ɲ
ƞ
Ŋŋ
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ
OEOeoEoeŒœ
ØøǾǿ
Ɔ
Ɵ
Pp
Ƥƥ
Qq
ĸ
RrŔŕŖŗŘř
RRRrrRrr
Ʀ
SsŚśŜŝŞşſ
SSSssSssß
Šš
Ʃ
ƪ
TtŢţŤť
ƾ
Ŧŧ
ƫ
Ƭƭ
Ʈ
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự
Ɯ
Ʊ
Vv
Ʋ
WwŴŵ
Xx
YyÝýÿŶŷŸ
Ƴƴ
ZzŹźŻż
ƍ
Žž
Ƶƶ
ƷǮǯ
Ƹƹ
ƺ
Þþ
ƿǷ
ƻ
Ƨƨ
Ƽƽ
Ƅƅ
ʼn
ǀ
ǁ
ǂ
ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci;
group_concat(c1 order by binary c1 separator '') group_concat(c1 order by binary c1 separator '')
÷ ÷
......
...@@ -2177,6 +2177,116 @@ ZzŹźŻżŽž ...@@ -2177,6 +2177,116 @@ ZzŹźŻżŽž
ǁ ǁ
ǂ ǂ
ǃ ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_mysql561_ci;
group_concat(c1 order by binary c1 separator '')
÷
×
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ
AAAaaAaa
AEAeaEae
ÆæǢǣǼǽ
Bb
ƀ
Ɓ
Ƃƃ
CcÇçĈĉĊċ
CHChcHch
Čč
Ćć
Ƈƈ
DdĎď
DZDzdZdzDZDzdz
DŽDždŽdžDŽDždž
Đđ
Ɖ
Ɗ
Ƌƌ
Ðð
EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ
Ǝǝ
Ə
Ɛ
Ff
Ƒƒ
GgĜĝĞğĠġĢģǦǧǴǵ
Ǥǥ
Ɠ
Ɣ
Ƣƣ
HhĤĥ
ƕǶ
Ħħ
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị
IJIjiJijIJij
ı
Ɨ
Ɩ
JjĴĵǰ
KkĶķǨǩ
Ƙƙ
LlĹĺĻļĽľ
Ŀŀ
LLLllLll
LJLjlJljLJLjlj
Łł
ƚ
ƛ
Mm
NnÑñŃńŅņŇňǸǹ
NJNjnJnjNJNjnj
Ɲ
ƞ
Ŋŋ
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ
OEOeoEoeŒœ
ØøǾǿ
Ɔ
Ɵ
Pp
Ƥƥ
Qq
ĸ
RrŔŕŖŗŘř
RRRrrRrr
Ʀ
SsŚśŜŝŞşſ
SSSssSssß
Šš
Ʃ
ƪ
TtŢţŤť
ƾ
Ŧŧ
ƫ
Ƭƭ
Ʈ
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự
Ɯ
Ʊ
Vv
Ʋ
WwŴŵ
Xx
YyÝýÿŶŷŸ
Ƴƴ
ZzŹźŻż
ƍ
Žž
Ƶƶ
ƷǮǯ
Ƹƹ
ƺ
Þþ
ƿǷ
ƻ
Ƨƨ
Ƽƽ
Ƅƅ
ʼn
ǀ
ǁ
ǂ
ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci;
group_concat(c1 order by binary c1 separator '') group_concat(c1 order by binary c1 separator '')
÷ ÷
......
...@@ -2138,6 +2138,116 @@ ZzŹźŻżŽž ...@@ -2138,6 +2138,116 @@ ZzŹźŻżŽž
ǁ ǁ
ǂ ǂ
ǃ ǃ
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_mysql561_ci;
GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '')
÷
×
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ
AAAaaAaa
AEAeaEae
ÆæǢǣǼǽ
Bb
ƀ
Ɓ
Ƃƃ
CcÇçĈĉĊċ
CHChcHch
Čč
Ćć
Ƈƈ
DdĎď
DZDzdZdzDZDzdz
DŽDždŽdžDŽDždž
Đđ
Ɖ
Ɗ
Ƌƌ
Ðð
EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ
Ǝǝ
Ə
Ɛ
Ff
Ƒƒ
GgĜĝĞğĠġĢģǦǧǴǵ
Ǥǥ
Ɠ
Ɣ
Ƣƣ
HhĤĥ
ƕǶ
Ħħ
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị
IJIjiJijIJij
ı
Ɨ
Ɩ
JjĴĵǰ
KkĶķǨǩ
Ƙƙ
LlĹĺĻļĽľ
Ŀŀ
LLLllLll
LJLjlJljLJLjlj
Łł
ƚ
ƛ
Mm
NnÑñŃńŅņŇňǸǹ
NJNjnJnjNJNjnj
Ɲ
ƞ
Ŋŋ
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ
OEOeoEoeŒœ
ØøǾǿ
Ɔ
Ɵ
Pp
Ƥƥ
Qq
ĸ
RrŔŕŖŗŘř
RRRrrRrr
Ʀ
SsŚśŜŝŞşſ
SSSssSssß
Šš
Ʃ
ƪ
TtŢţŤť
ƾ
Ŧŧ
ƫ
Ƭƭ
Ʈ
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự
Ɯ
Ʊ
Vv
Ʋ
WwŴŵ
Xx
YyÝýÿŶŷŸ
Ƴƴ
ZzŹźŻż
ƍ
Žž
Ƶƶ
ƷǮǯ
Ƹƹ
ƺ
Þþ
ƿǷ
ƻ
Ƨƨ
Ƽƽ
Ƅƅ
ʼn
ǀ
ǁ
ǂ
ǃ
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_ci;
GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '')
÷ ÷
......
...@@ -78,8 +78,9 @@ utf8_esperanto_ci utf8 209 # # ...@@ -78,8 +78,9 @@ utf8_esperanto_ci utf8 209 # #
utf8_hungarian_ci utf8 210 # # utf8_hungarian_ci utf8 210 # #
utf8_sinhala_ci utf8 211 # # utf8_sinhala_ci utf8 211 # #
utf8_german2_ci utf8 212 # # utf8_german2_ci utf8 212 # #
utf8_croatian_ci utf8 213 # # utf8_croatian_mysql561_ci utf8 213 # #
utf8_general_mysql500_ci utf8 223 # # utf8_general_mysql500_ci utf8 223 # #
utf8_croatian_ci utf8 576 # #
ucs2_general_ci ucs2 35 Yes # # ucs2_general_ci ucs2 35 Yes # #
ucs2_bin ucs2 90 # # ucs2_bin ucs2 90 # #
ucs2_unicode_ci ucs2 128 # # ucs2_unicode_ci ucs2 128 # #
...@@ -103,8 +104,9 @@ ucs2_esperanto_ci ucs2 145 # # ...@@ -103,8 +104,9 @@ ucs2_esperanto_ci ucs2 145 # #
ucs2_hungarian_ci ucs2 146 # # ucs2_hungarian_ci ucs2 146 # #
ucs2_sinhala_ci ucs2 147 # # ucs2_sinhala_ci ucs2 147 # #
ucs2_german2_ci ucs2 148 # # ucs2_german2_ci ucs2 148 # #
ucs2_croatian_ci ucs2 149 # # ucs2_croatian_mysql561_ci ucs2 149 # #
ucs2_general_mysql500_ci ucs2 159 # # ucs2_general_mysql500_ci ucs2 159 # #
ucs2_croatian_ci ucs2 640 # #
cp866_general_ci cp866 36 Yes # # cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # # cp866_bin cp866 68 # #
keybcs2_general_ci keybcs2 37 Yes # # keybcs2_general_ci keybcs2 37 Yes # #
...@@ -142,7 +144,8 @@ utf8mb4_esperanto_ci utf8mb4 241 # # ...@@ -142,7 +144,8 @@ utf8mb4_esperanto_ci utf8mb4 241 # #
utf8mb4_hungarian_ci utf8mb4 242 # # utf8mb4_hungarian_ci utf8mb4 242 # #
utf8mb4_sinhala_ci utf8mb4 243 # # utf8mb4_sinhala_ci utf8mb4 243 # #
utf8mb4_german2_ci utf8mb4 244 # # utf8mb4_german2_ci utf8mb4 244 # #
utf8mb4_croatian_ci utf8mb4 245 # # utf8mb4_croatian_mysql561_ci utf8mb4 245 # #
utf8mb4_croatian_ci utf8mb4 608 # #
cp1251_bulgarian_ci cp1251 14 # # cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # # cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # # cp1251_bin cp1251 50 # #
...@@ -171,7 +174,8 @@ utf16_esperanto_ci utf16 118 # # ...@@ -171,7 +174,8 @@ utf16_esperanto_ci utf16 118 # #
utf16_hungarian_ci utf16 119 # # utf16_hungarian_ci utf16 119 # #
utf16_sinhala_ci utf16 120 # # utf16_sinhala_ci utf16 120 # #
utf16_german2_ci utf16 121 # # utf16_german2_ci utf16 121 # #
utf16_croatian_ci utf16 215 # # utf16_croatian_mysql561_ci utf16 122 # #
utf16_croatian_ci utf16 672 # #
utf16le_general_ci utf16le 56 Yes # # utf16le_general_ci utf16le 56 Yes # #
utf16le_bin utf16le 62 # # utf16le_bin utf16le 62 # #
cp1256_general_ci cp1256 57 Yes # # cp1256_general_ci cp1256 57 Yes # #
...@@ -202,7 +206,8 @@ utf32_esperanto_ci utf32 177 # # ...@@ -202,7 +206,8 @@ utf32_esperanto_ci utf32 177 # #
utf32_hungarian_ci utf32 178 # # utf32_hungarian_ci utf32 178 # #
utf32_sinhala_ci utf32 179 # # utf32_sinhala_ci utf32 179 # #
utf32_german2_ci utf32 180 # # utf32_german2_ci utf32 180 # #
utf32_croatian_ci utf32 214 # # utf32_croatian_mysql561_ci utf32 181 # #
utf32_croatian_ci utf32 736 # #
binary binary 63 Yes # # binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # # geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # # geostd8_bin geostd8 93 # #
......
...@@ -78,8 +78,9 @@ utf8_esperanto_ci utf8 209 # # ...@@ -78,8 +78,9 @@ utf8_esperanto_ci utf8 209 # #
utf8_hungarian_ci utf8 210 # # utf8_hungarian_ci utf8 210 # #
utf8_sinhala_ci utf8 211 # # utf8_sinhala_ci utf8 211 # #
utf8_german2_ci utf8 212 # # utf8_german2_ci utf8 212 # #
utf8_croatian_ci utf8 213 # # utf8_croatian_mysql561_ci utf8 213 # #
utf8_general_mysql500_ci utf8 223 # # utf8_general_mysql500_ci utf8 223 # #
utf8_croatian_ci utf8 576 # #
ucs2_general_ci ucs2 35 Yes # # ucs2_general_ci ucs2 35 Yes # #
ucs2_bin ucs2 90 # # ucs2_bin ucs2 90 # #
ucs2_unicode_ci ucs2 128 # # ucs2_unicode_ci ucs2 128 # #
...@@ -103,8 +104,9 @@ ucs2_esperanto_ci ucs2 145 # # ...@@ -103,8 +104,9 @@ ucs2_esperanto_ci ucs2 145 # #
ucs2_hungarian_ci ucs2 146 # # ucs2_hungarian_ci ucs2 146 # #
ucs2_sinhala_ci ucs2 147 # # ucs2_sinhala_ci ucs2 147 # #
ucs2_german2_ci ucs2 148 # # ucs2_german2_ci ucs2 148 # #
ucs2_croatian_ci ucs2 149 # # ucs2_croatian_mysql561_ci ucs2 149 # #
ucs2_general_mysql500_ci ucs2 159 # # ucs2_general_mysql500_ci ucs2 159 # #
ucs2_croatian_ci ucs2 640 # #
cp866_general_ci cp866 36 Yes # # cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # # cp866_bin cp866 68 # #
keybcs2_general_ci keybcs2 37 Yes # # keybcs2_general_ci keybcs2 37 Yes # #
...@@ -142,7 +144,8 @@ utf8mb4_esperanto_ci utf8mb4 241 # # ...@@ -142,7 +144,8 @@ utf8mb4_esperanto_ci utf8mb4 241 # #
utf8mb4_hungarian_ci utf8mb4 242 # # utf8mb4_hungarian_ci utf8mb4 242 # #
utf8mb4_sinhala_ci utf8mb4 243 # # utf8mb4_sinhala_ci utf8mb4 243 # #
utf8mb4_german2_ci utf8mb4 244 # # utf8mb4_german2_ci utf8mb4 244 # #
utf8mb4_croatian_ci utf8mb4 245 # # utf8mb4_croatian_mysql561_ci utf8mb4 245 # #
utf8mb4_croatian_ci utf8mb4 608 # #
cp1251_bulgarian_ci cp1251 14 # # cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # # cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # # cp1251_bin cp1251 50 # #
...@@ -171,7 +174,8 @@ utf16_esperanto_ci utf16 118 # # ...@@ -171,7 +174,8 @@ utf16_esperanto_ci utf16 118 # #
utf16_hungarian_ci utf16 119 # # utf16_hungarian_ci utf16 119 # #
utf16_sinhala_ci utf16 120 # # utf16_sinhala_ci utf16 120 # #
utf16_german2_ci utf16 121 # # utf16_german2_ci utf16 121 # #
utf16_croatian_ci utf16 215 # # utf16_croatian_mysql561_ci utf16 122 # #
utf16_croatian_ci utf16 672 # #
utf16le_general_ci utf16le 56 Yes # # utf16le_general_ci utf16le 56 Yes # #
utf16le_bin utf16le 62 # # utf16le_bin utf16le 62 # #
cp1256_general_ci cp1256 57 Yes # # cp1256_general_ci cp1256 57 Yes # #
...@@ -202,7 +206,8 @@ utf32_esperanto_ci utf32 177 # # ...@@ -202,7 +206,8 @@ utf32_esperanto_ci utf32 177 # #
utf32_hungarian_ci utf32 178 # # utf32_hungarian_ci utf32 178 # #
utf32_sinhala_ci utf32 179 # # utf32_sinhala_ci utf32 179 # #
utf32_german2_ci utf32 180 # # utf32_german2_ci utf32 180 # #
utf32_croatian_ci utf32 214 # # utf32_croatian_mysql561_ci utf32 181 # #
utf32_croatian_ci utf32 736 # #
binary binary 63 Yes # # binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # # geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # # geostd8_bin geostd8 93 # #
......
...@@ -170,7 +170,7 @@ select "foo" = "foo " collate latin1_test; ...@@ -170,7 +170,7 @@ select "foo" = "foo " collate latin1_test;
# The file ../std-data/Index.xml has a number of collations with high IDs. # The file ../std-data/Index.xml has a number of collations with high IDs.
# Test that the "ID" column in I_S and SHOW queries can handle two bytes # Test that the "ID" column in I_S and SHOW queries can handle two bytes
select * from information_schema.collations where id>256 order by id; select * from information_schema.collations where id>256 and is_compiled<>'Yes' order by id;
show collation like '%test%'; show collation like '%test%';
# Test that two-byte collation ID is correctly transfered to the client side. # Test that two-byte collation ID is correctly transfered to the client side.
......
...@@ -4,8 +4,8 @@ Variable_name Value ...@@ -4,8 +4,8 @@ Variable_name Value
Opened_plugin_libraries 0 Opened_plugin_libraries 0
select * from information_schema.all_plugins where plugin_library='ha_example.so'; select * from information_schema.all_plugins where plugin_library='ha_example.so';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION
EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE 100004.0 ha_example.so 1.7 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1 EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE 100006.0 ha_example.so 1.7 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
UNUSABLE 3.14 NOT INSTALLED DAEMON 100004.0 ha_example.so 1.7 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926 UNUSABLE 3.14 NOT INSTALLED DAEMON 100006.0 ha_example.so 1.7 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%'; show status like '%libraries%';
Variable_name Value Variable_name Value
Opened_plugin_libraries 1 Opened_plugin_libraries 1
......
...@@ -2,7 +2,7 @@ use mysql; ...@@ -2,7 +2,7 @@ use mysql;
alter table user drop column is_role; alter table user drop column is_role;
flush privileges; flush privileges;
create role test_role; create role test_role;
ERROR HY000: Column count of mysql.user is wrong. Expected 44, found 43. Created with MariaDB 100004, now running 100004. Please use mysql_upgrade to fix this error. ERROR HY000: Column count of mysql.user is wrong. Expected 44, found 43. Created with MariaDB 100006, now running 100006. Please use mysql_upgrade to fix this error.
drop role test_role; drop role test_role;
ERROR HY000: Operation DROP ROLE failed for 'test_role' ERROR HY000: Operation DROP ROLE failed for 'test_role'
alter table user add column is_role enum('N', 'Y') default 'N' not null alter table user add column is_role enum('N', 'Y') default 'N' not null
......
...@@ -152,7 +152,7 @@ select "foo" = "foo " collate latin1_test; ...@@ -152,7 +152,7 @@ select "foo" = "foo " collate latin1_test;
# The file ../std-data/Index.xml has a number of collations with high IDs. # The file ../std-data/Index.xml has a number of collations with high IDs.
# Test that the "ID" column in I_S and SHOW queries can handle two bytes # Test that the "ID" column in I_S and SHOW queries can handle two bytes
select * from information_schema.collations where id>256 order by id; select * from information_schema.collations where id>256 and is_compiled<>'Yes' order by id;
show collation like '%test%'; show collation like '%test%';
# Test that two-byte collation ID is correctly transfered to the client side. # Test that two-byte collation ID is correctly transfered to the client side.
......
...@@ -65,6 +65,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci ...@@ -65,6 +65,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_mysql561_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci;
...@@ -87,6 +88,7 @@ SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_spanish2_ci ...@@ -87,6 +88,7 @@ SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_spanish2_ci
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_roman_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_roman_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_esperanto_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_esperanto_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_hungarian_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_hungarian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_mysql561_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_german2_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_german2_ci;
...@@ -485,7 +487,7 @@ SET collation_connection=ucs2_czech_ci; ...@@ -485,7 +487,7 @@ SET collation_connection=ucs2_czech_ci;
--source include/ctype_czech.inc --source include/ctype_czech.inc
--source include/ctype_like_ignorable.inc --source include/ctype_like_ignorable.inc
create table t1 (a int, c1 varchar(200) collate utf8_croatian_ci, key (c1)); create table t1 (a int, c1 varchar(200) collate utf8_croatian_mysql561_ci, key (c1));
insert into t1 values (1,'=> DZ'),(2,'=> Dz'),(3,'=> dz'),(4,'=> dZ'); insert into t1 values (1,'=> DZ'),(2,'=> Dz'),(3,'=> dz'),(4,'=> dZ');
insert into t1 values (5,'=> DŽ'),(6,'=> Dž'),(7,'=> dž'),(8,'=> dŽ'); insert into t1 values (5,'=> DŽ'),(6,'=> Dž'),(7,'=> dž'),(8,'=> dŽ');
insert into t1 values (9,'=> dž'),(10,'=> DŽ'); insert into t1 values (9,'=> dž'),(10,'=> DŽ');
......
This diff is collapsed.
...@@ -52,6 +52,7 @@ select group_concat(c1 order by binary c1 separator '') from t1 group by c1 coll ...@@ -52,6 +52,7 @@ select group_concat(c1 order by binary c1 separator '') from t1 group by c1 coll
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_mysql561_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_german2_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_german2_ci;
......
...@@ -53,6 +53,7 @@ select group_concat(c1 order by binary c1 separator '') from t1 group by c1 coll ...@@ -53,6 +53,7 @@ select group_concat(c1 order by binary c1 separator '') from t1 group by c1 coll
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_mysql561_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci;
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_german2_ci; select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_german2_ci;
......
...@@ -32,6 +32,7 @@ SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf ...@@ -32,6 +32,7 @@ SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_roman_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_roman_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_esperanto_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_esperanto_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_hungarian_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_hungarian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_mysql561_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_croatian_ci;
SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_german2_ci; SELECT GROUP_CONCAT(c1 ORDER BY c1 SEPARATOR '') FROM t1 GROUP BY c1 COLLATE utf8mb4_german2_ci;
......
...@@ -43,6 +43,7 @@ extern struct charset_info_st my_charset_ucs2_roman_uca_ci; ...@@ -43,6 +43,7 @@ extern struct charset_info_st my_charset_ucs2_roman_uca_ci;
extern struct charset_info_st my_charset_ucs2_persian_uca_ci; extern struct charset_info_st my_charset_ucs2_persian_uca_ci;
extern struct charset_info_st my_charset_ucs2_esperanto_uca_ci; extern struct charset_info_st my_charset_ucs2_esperanto_uca_ci;
extern struct charset_info_st my_charset_ucs2_hungarian_uca_ci; extern struct charset_info_st my_charset_ucs2_hungarian_uca_ci;
extern struct charset_info_st my_charset_ucs2_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_ucs2_sinhala_uca_ci; extern struct charset_info_st my_charset_ucs2_sinhala_uca_ci;
extern struct charset_info_st my_charset_ucs2_croatian_uca_ci; extern struct charset_info_st my_charset_ucs2_croatian_uca_ci;
#endif #endif
...@@ -68,6 +69,7 @@ extern struct charset_info_st my_charset_utf32_roman_uca_ci; ...@@ -68,6 +69,7 @@ extern struct charset_info_st my_charset_utf32_roman_uca_ci;
extern struct charset_info_st my_charset_utf32_persian_uca_ci; extern struct charset_info_st my_charset_utf32_persian_uca_ci;
extern struct charset_info_st my_charset_utf32_esperanto_uca_ci; extern struct charset_info_st my_charset_utf32_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf32_hungarian_uca_ci; extern struct charset_info_st my_charset_utf32_hungarian_uca_ci;
extern struct charset_info_st my_charset_utf32_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf32_sinhala_uca_ci; extern struct charset_info_st my_charset_utf32_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf32_croatian_uca_ci; extern struct charset_info_st my_charset_utf32_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf32 */ #endif /* HAVE_CHARSET_utf32 */
...@@ -93,6 +95,7 @@ extern struct charset_info_st my_charset_utf16_roman_uca_ci; ...@@ -93,6 +95,7 @@ extern struct charset_info_st my_charset_utf16_roman_uca_ci;
extern struct charset_info_st my_charset_utf16_persian_uca_ci; extern struct charset_info_st my_charset_utf16_persian_uca_ci;
extern struct charset_info_st my_charset_utf16_esperanto_uca_ci; extern struct charset_info_st my_charset_utf16_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf16_hungarian_uca_ci; extern struct charset_info_st my_charset_utf16_hungarian_uca_ci;
extern struct charset_info_st my_charset_utf16_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf16_sinhala_uca_ci; extern struct charset_info_st my_charset_utf16_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf16_croatian_uca_ci; extern struct charset_info_st my_charset_utf16_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf16 */ #endif /* HAVE_CHARSET_utf16 */
...@@ -118,6 +121,7 @@ extern struct charset_info_st my_charset_utf8_roman_uca_ci; ...@@ -118,6 +121,7 @@ extern struct charset_info_st my_charset_utf8_roman_uca_ci;
extern struct charset_info_st my_charset_utf8_persian_uca_ci; extern struct charset_info_st my_charset_utf8_persian_uca_ci;
extern struct charset_info_st my_charset_utf8_esperanto_uca_ci; extern struct charset_info_st my_charset_utf8_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf8_hungarian_uca_ci; extern struct charset_info_st my_charset_utf8_hungarian_uca_ci;
extern struct charset_info_st my_charset_utf8_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf8_sinhala_uca_ci; extern struct charset_info_st my_charset_utf8_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf8_croatian_uca_ci; extern struct charset_info_st my_charset_utf8_croatian_uca_ci;
#ifdef HAVE_UTF8_GENERAL_CS #ifdef HAVE_UTF8_GENERAL_CS
...@@ -145,6 +149,7 @@ extern struct charset_info_st my_charset_utf8mb4_roman_uca_ci; ...@@ -145,6 +149,7 @@ extern struct charset_info_st my_charset_utf8mb4_roman_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_persian_uca_ci; extern struct charset_info_st my_charset_utf8mb4_persian_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci; extern struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci; extern struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_croatian_mysql561_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci; extern struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci;
extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci; extern struct charset_info_st my_charset_utf8mb4_croatian_uca_ci;
#endif /* HAVE_CHARSET_utf8mb4 */ #endif /* HAVE_CHARSET_utf8mb4 */
...@@ -235,6 +240,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -235,6 +240,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_persian_uca_ci); add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci); add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci);
add_compiled_collation(&my_charset_ucs2_hungarian_uca_ci); add_compiled_collation(&my_charset_ucs2_hungarian_uca_ci);
add_compiled_collation(&my_charset_ucs2_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_ucs2_sinhala_uca_ci); add_compiled_collation(&my_charset_ucs2_sinhala_uca_ci);
add_compiled_collation(&my_charset_ucs2_croatian_uca_ci); add_compiled_collation(&my_charset_ucs2_croatian_uca_ci);
#endif #endif
...@@ -273,6 +279,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -273,6 +279,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_persian_uca_ci); add_compiled_collation(&my_charset_utf8_persian_uca_ci);
add_compiled_collation(&my_charset_utf8_esperanto_uca_ci); add_compiled_collation(&my_charset_utf8_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf8_hungarian_uca_ci); add_compiled_collation(&my_charset_utf8_hungarian_uca_ci);
add_compiled_collation(&my_charset_utf8_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf8_sinhala_uca_ci); add_compiled_collation(&my_charset_utf8_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf8_croatian_uca_ci); add_compiled_collation(&my_charset_utf8_croatian_uca_ci);
#endif #endif
...@@ -303,6 +310,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -303,6 +310,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8mb4_persian_uca_ci); add_compiled_collation(&my_charset_utf8mb4_persian_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_esperanto_uca_ci); add_compiled_collation(&my_charset_utf8mb4_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_hungarian_uca_ci); add_compiled_collation(&my_charset_utf8mb4_hungarian_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_sinhala_uca_ci); add_compiled_collation(&my_charset_utf8mb4_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf8mb4_croatian_uca_ci); add_compiled_collation(&my_charset_utf8mb4_croatian_uca_ci);
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
...@@ -335,6 +343,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -335,6 +343,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf16_persian_uca_ci); add_compiled_collation(&my_charset_utf16_persian_uca_ci);
add_compiled_collation(&my_charset_utf16_esperanto_uca_ci); add_compiled_collation(&my_charset_utf16_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf16_hungarian_uca_ci); add_compiled_collation(&my_charset_utf16_hungarian_uca_ci);
add_compiled_collation(&my_charset_utf16_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf16_sinhala_uca_ci); add_compiled_collation(&my_charset_utf16_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf16_croatian_uca_ci); add_compiled_collation(&my_charset_utf16_croatian_uca_ci);
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
...@@ -365,6 +374,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) ...@@ -365,6 +374,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf32_persian_uca_ci); add_compiled_collation(&my_charset_utf32_persian_uca_ci);
add_compiled_collation(&my_charset_utf32_esperanto_uca_ci); add_compiled_collation(&my_charset_utf32_esperanto_uca_ci);
add_compiled_collation(&my_charset_utf32_hungarian_uca_ci); add_compiled_collation(&my_charset_utf32_hungarian_uca_ci);
add_compiled_collation(&my_charset_utf32_croatian_mysql561_uca_ci);
add_compiled_collation(&my_charset_utf32_sinhala_uca_ci); add_compiled_collation(&my_charset_utf32_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf32_croatian_uca_ci); add_compiled_collation(&my_charset_utf32_croatian_uca_ci);
#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_UCA_COLLATIONS */
......
...@@ -648,19 +648,19 @@ get_internal_charset(MY_CHARSET_LOADER *loader, uint cs_number, myf flags) ...@@ -648,19 +648,19 @@ get_internal_charset(MY_CHARSET_LOADER *loader, uint cs_number, myf flags)
CHARSET_INFO *get_charset(uint cs_number, myf flags) CHARSET_INFO *get_charset(uint cs_number, myf flags)
{ {
CHARSET_INFO *cs; CHARSET_INFO *cs= NULL;
MY_CHARSET_LOADER loader;
if (cs_number == default_charset_info->number) if (cs_number == default_charset_info->number)
return default_charset_info; return default_charset_info;
my_pthread_once(&charsets_initialized, init_available_charsets); my_pthread_once(&charsets_initialized, init_available_charsets);
if (cs_number >= array_elements(all_charsets)) if (cs_number < array_elements(all_charsets))
return NULL; {
MY_CHARSET_LOADER loader;
my_charset_loader_init_mysys(&loader); my_charset_loader_init_mysys(&loader);
cs= get_internal_charset(&loader, cs_number, flags); cs= get_internal_charset(&loader, cs_number, flags);
}
if (!cs && (flags & MY_WME)) if (!cs && (flags & MY_WME))
{ {
......
...@@ -3534,6 +3534,38 @@ bool handler::get_error_message(int error, String* buf) ...@@ -3534,6 +3534,38 @@ bool handler::get_error_message(int error, String* buf)
return FALSE; return FALSE;
} }
/**
Check if a collation has changed number
@param mysql_version
@param current collation number
@retval new collation number (same as current collation number of no change)
*/
uint upgrade_collation(ulong mysql_version, uint cs_number)
{
if (mysql_version >= 50300 && mysql_version <= 50399)
{
switch (cs_number) {
case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
}
}
if ((mysql_version >= 50500 && mysql_version <= 50599) ||
(mysql_version >= 100000 && mysql_version <= 100005))
{
switch (cs_number) {
case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
case 214: return MY_PAGE2_COLLATION_ID_UTF32; // utf32_croatian_ci
case 215: return MY_PAGE2_COLLATION_ID_UTF16; // utf16_croatian_ci
case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci
}
}
return cs_number;
}
/** /**
Check for incompatible collation changes. Check for incompatible collation changes.
...@@ -3578,6 +3610,26 @@ int handler::check_collation_compatibility() ...@@ -3578,6 +3610,26 @@ int handler::check_collation_compatibility()
} }
} }
} }
if (mysql_version < 100006)
{
/*
Check if we are using collations from that has changed numbering.
This happend at least between MariaDB 5.5 and MariaDB 10.0 as MySQL
added conflicting numbers.
*/
if (table->s->table_charset->number !=
upgrade_collation(mysql_version, table->s->table_charset->number))
return HA_ADMIN_NEEDS_ALTER;
for (Field **field= table->field; (*field); field++)
{
if ((*field)->charset()->number !=
upgrade_collation(mysql_version, (*field)->charset()->number))
return HA_ADMIN_NEEDS_ALTER;
}
}
return 0; return 0;
} }
...@@ -3588,6 +3640,9 @@ int handler::ha_check_for_upgrade(HA_CHECK_OPT *check_opt) ...@@ -3588,6 +3640,9 @@ int handler::ha_check_for_upgrade(HA_CHECK_OPT *check_opt)
KEY *keyinfo, *keyend; KEY *keyinfo, *keyend;
KEY_PART_INFO *keypart, *keypartend; KEY_PART_INFO *keypart, *keypartend;
if (table->s->incompatible_version)
return HA_ADMIN_NEEDS_ALTER;
if (!table->s->mysql_version) if (!table->s->mysql_version)
{ {
/* check for blob-in-key error */ /* check for blob-in-key error */
......
...@@ -4055,4 +4055,5 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name) ...@@ -4055,4 +4055,5 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name)
void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag); void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag);
void print_keydup_error(TABLE *table, KEY *key, myf errflag); void print_keydup_error(TABLE *table, KEY *key, myf errflag);
uint upgrade_collation(ulong mysql_version, uint cs_number);
#endif #endif
...@@ -6740,7 +6740,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, ...@@ -6740,7 +6740,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
List<Key_part_spec> key_parts; List<Key_part_spec> key_parts;
uint db_create_options= (table->s->db_create_options uint db_create_options= (table->s->db_create_options
& ~(HA_OPTION_PACK_RECORD)); & ~(HA_OPTION_PACK_RECORD));
uint used_fields= create_info->used_fields; uint used_fields;
KEY *key_info=table->key_info; KEY *key_info=table->key_info;
bool rc= TRUE; bool rc= TRUE;
bool modified_primary_key= FALSE; bool modified_primary_key= FALSE;
...@@ -6748,6 +6748,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, ...@@ -6748,6 +6748,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
Field **f_ptr,*field; Field **f_ptr,*field;
DBUG_ENTER("mysql_prepare_alter_table"); DBUG_ENTER("mysql_prepare_alter_table");
/*
Merge incompatible changes flag in case of upgrade of a table from an
old MariaDB or MySQL version. This ensures that we don't try to do an
online alter table if field packing or character set changes are required.
*/
create_info->used_fields|= table->s->incompatible_version;
used_fields= create_info->used_fields;
create_info->varchar= FALSE; create_info->varchar= FALSE;
/* Let new create options override the old ones */ /* Let new create options override the old ones */
if (!(used_fields & HA_CREATE_USED_MIN_ROWS)) if (!(used_fields & HA_CREATE_USED_MIN_ROWS))
...@@ -7732,8 +7740,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -7732,8 +7740,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DEBUG_SYNC(thd, "alter_table_before_open_tables"); DEBUG_SYNC(thd, "alter_table_before_open_tables");
uint tables_opened; uint tables_opened;
thd->open_options|= HA_OPEN_FOR_ALTER;
bool error= open_tables(thd, &table_list, &tables_opened, 0, bool error= open_tables(thd, &table_list, &tables_opened, 0,
&alter_prelocking_strategy); &alter_prelocking_strategy);
thd->open_options&= ~HA_OPEN_FOR_ALTER;
DEBUG_SYNC(thd, "alter_opened_table"); DEBUG_SYNC(thd, "alter_opened_table");
......
...@@ -1009,12 +1009,18 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -1009,12 +1009,18 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
share->null_field_first= 0; share->null_field_first= 0;
if (!frm_image[32]) // New frm file in 3.23 if (!frm_image[32]) // New frm file in 3.23
{ {
uint cs_org= (((uint) frm_image[41]) << 8) + (uint) frm_image[38];
uint cs_new= upgrade_collation(share->mysql_version, cs_org);
if (cs_org != cs_new)
share->incompatible_version|= HA_CREATE_USED_CHARSET;
share->avg_row_length= uint4korr(frm_image+34); share->avg_row_length= uint4korr(frm_image+34);
share->transactional= (ha_choice) (frm_image[39] & 3); share->transactional= (ha_choice) (frm_image[39] & 3);
share->page_checksum= (ha_choice) ((frm_image[39] >> 2) & 3); share->page_checksum= (ha_choice) ((frm_image[39] >> 2) & 3);
share->row_type= (enum row_type) frm_image[40]; share->row_type= (enum row_type) frm_image[40];
share->table_charset= get_charset((((uint) frm_image[41]) << 8) +
(uint) frm_image[38], MYF(0)); if (cs_new && !(share->table_charset= get_charset(cs_new, MYF(MY_WME))))
goto err;
share->null_field_first= 1; share->null_field_first= 1;
share->stats_sample_pages= uint2korr(frm_image+42); share->stats_sample_pages= uint2korr(frm_image+42);
share->stats_auto_recalc= (enum_stats_auto_recalc)(frm_image[44]); share->stats_auto_recalc= (enum_stats_auto_recalc)(frm_image[44]);
...@@ -1032,6 +1038,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -1032,6 +1038,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
} }
share->table_charset= default_charset_info; share->table_charset= default_charset_info;
} }
share->db_record_offset= 1; share->db_record_offset= 1;
share->max_rows= uint4korr(frm_image+18); share->max_rows= uint4korr(frm_image+18);
share->min_rows= uint4korr(frm_image+22); share->min_rows= uint4korr(frm_image+22);
...@@ -1418,16 +1425,19 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -1418,16 +1425,19 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
} }
else else
{ {
uint csid= strpos[14] + (((uint) strpos[11]) << 8); uint cs_org= strpos[14] + (((uint) strpos[11]) << 8);
if (!csid) uint cs_new= upgrade_collation(share->mysql_version, cs_org);
if (cs_org != cs_new)
share->incompatible_version|= HA_CREATE_USED_CHARSET;
if (!cs_new)
charset= &my_charset_bin; charset= &my_charset_bin;
else if (!(charset= get_charset(csid, MYF(0)))) else if (!(charset= get_charset(cs_new, MYF(0))))
{ {
const char *csname= get_charset_name((uint) csid); const char *csname= get_charset_name((uint) cs_new);
char tmp[10]; char tmp[10];
if (!csname || csname[0] =='?') if (!csname || csname[0] =='?')
{ {
my_snprintf(tmp, sizeof(tmp), "#%d", csid); my_snprintf(tmp, sizeof(tmp), "#%d", cs_new);
csname= tmp; csname= tmp;
} }
my_printf_error(ER_UNKNOWN_COLLATION, my_printf_error(ER_UNKNOWN_COLLATION,
...@@ -2489,6 +2499,13 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share, ...@@ -2489,6 +2499,13 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
outparam->db_stat= db_stat; outparam->db_stat= db_stat;
outparam->write_row_record= NULL; outparam->write_row_record= NULL;
if (share->incompatible_version &&
!(ha_open_flags & (HA_OPEN_FOR_ALTER | HA_OPEN_FOR_REPAIR)))
{
/* one needs to run mysql_upgrade on the table */
error= OPEN_FRM_NEEDS_REBUILD;
goto err;
}
init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0)); init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (outparam->alias.copy(alias, strlen(alias), table_alias_charset)) if (outparam->alias.copy(alias, strlen(alias), table_alias_charset))
...@@ -3012,6 +3029,11 @@ void open_table_error(TABLE_SHARE *share, enum open_frm_error error, ...@@ -3012,6 +3029,11 @@ void open_table_error(TABLE_SHARE *share, enum open_frm_error error,
strxmov(buff, share->normalized_path.str, reg_ext, NullS); strxmov(buff, share->normalized_path.str, reg_ext, NullS);
my_error(ER_ERROR_ON_READ, errortype, buff, db_errno); my_error(ER_ERROR_ON_READ, errortype, buff, db_errno);
break; break;
case OPEN_FRM_NEEDS_REBUILD:
strxnmov(buff, sizeof(buff)-1,
share->db.str, ".", share->table_name.str, NullS);
my_error(ER_TABLE_NEEDS_REBUILD, errortype, buff);
break;
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} /* open_table_error */ } /* open_table_error */
......
...@@ -560,7 +560,8 @@ enum open_frm_error { ...@@ -560,7 +560,8 @@ enum open_frm_error {
OPEN_FRM_DISCOVER, OPEN_FRM_DISCOVER,
OPEN_FRM_ERROR_ALREADY_ISSUED, OPEN_FRM_ERROR_ALREADY_ISSUED,
OPEN_FRM_NOT_A_VIEW, OPEN_FRM_NOT_A_VIEW,
OPEN_FRM_NOT_A_TABLE OPEN_FRM_NOT_A_TABLE,
OPEN_FRM_NEEDS_REBUILD
}; };
/** /**
...@@ -733,6 +734,13 @@ struct TABLE_SHARE ...@@ -733,6 +734,13 @@ struct TABLE_SHARE
bool can_cmp_whole_record; bool can_cmp_whole_record;
ulong table_map_id; /* for row-based replication */ ulong table_map_id; /* for row-based replication */
/*
Things that are incompatible between the stored version and the
current version. This is a set of HA_CREATE... bits that can be used
to modify create_info->used_fields for ALTER TABLE.
*/
ulong incompatible_version;
/* /*
Cache for row-based replication table share checks that does not Cache for row-based replication table share checks that does not
need to be repeated. Possible values are: -1 when cache value is need to be repeated. Possible values are: -1 when cache value is
......
...@@ -3765,7 +3765,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, ...@@ -3765,7 +3765,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
#if defined(WIN32) #if defined(WIN32)
char *nsp= NULL, *cls= NULL; char *nsp= NULL, *cls= NULL;
#endif // WIN32 #endif // WIN32
int port= 0, hdr= 0, mxr= 0, rc= 0, cop= 0; int port= 0, hdr= 0, mxr= 0, rc= 0;
int cop __attribute__((unused)) = 0;
uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL); uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL);
bool bif, ok= false, dbf= false; bool bif, ok= false, dbf= false;
TABTYPE ttp= TAB_UNDEF; TABTYPE ttp= TAB_UNDEF;
......
This diff is collapsed.
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