Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
Table and database level CHARACTER SET and COLLATE clauses can go in any order. So both these syntaxes are correct:
- CHARACTER SET .. COLLATE
- COLLATE .. CHARACTER SET
But they can produce errors differently:
CREATE OR REPLACE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET DEFAULT; |
ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT'
|
CREATE OR REPLACE TABLE t1 (a CHAR) CHARACTER SET DEFAULT COLLATE latin1_bin; |
Query OK, 0 rows affected (0.014 sec)
|
The same problem is repeatable on the database level:
CREATE OR REPLACE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT; |
ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT'
|
CREATE OR REPLACE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin; |
Query OK, 0 rows affected (0.014 sec)
|
Attachments
Issue Links
- relates to
-
MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
-
- Closed
-
-
MDEV-28117 Multiple conflicting table COLLATE clauses are not rejected
-
- Closed
-
-
MDEV-27009 Add UCA-14.0.0 collations
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Description |
Table and database level CHARACTER SET and COLLATE clauses can go in any order. So both these syntaxes are correct:
- CHARACTER SET .. COLLATE - COLLATE .. CHARACTER SET But they can produce errors differently: {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} This statement is expected to produce an error. The same problem is repeatable on the database level: {code:sql} CREATE OR REPLACE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) |
Table and database level CHARACTER SET and COLLATE clauses can go in any order. So both these syntaxes are correct:
- CHARACTER SET .. COLLATE - COLLATE .. CHARACTER SET But they can produce errors differently: {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} This statement is expected to produce an error. The same problem is repeatable on the database level: {code:sql} CREATE OR REPLACE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} |
Description |
Table and database level CHARACTER SET and COLLATE clauses can go in any order. So both these syntaxes are correct:
- CHARACTER SET .. COLLATE - COLLATE .. CHARACTER SET But they can produce errors differently: {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} This statement is expected to produce an error. The same problem is repeatable on the database level: {code:sql} CREATE OR REPLACE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} |
Table and database level CHARACTER SET and COLLATE clauses can go in any order. So both these syntaxes are correct:
- CHARACTER SET .. COLLATE - COLLATE .. CHARACTER SET But they can produce errors differently: {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE TABLE t1 (a CHAR) CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} The same problem is repeatable on the database level: {code:sql} CREATE OR REPLACE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT; {code} {noformat} ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' {noformat} {code:sql} CREATE OR REPLACE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin; {code} {noformat} Query OK, 0 rows affected (0.014 sec) {noformat} |
issue.field.resolutiondate | 2022-06-07 02:34:06.0 | 2022-06-07 02:34:06.653 |
Fix Version/s | 10.9.2 [ 27115 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |