1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-18428 Memory: If transactional=0 is specified in CREATE TABLE, it is not possible to ALTER TABLE

* be strict in CREATE TABLE, just like in ALTER TABLE, because
  CREATE TABLE, just like ALTER TABLE, can be rolled back for any engine
* but don't auto-convert warnings into errors for engine warnings
  (handler::create) - this matches ALTER TABLE behavior
* and not when creating a default record, these errors are handled
  specially (and replaced with ER_INVALID_DEFAULT)
* always issue a Note when a non-unique key is truncated, because it's
  not a Warning that can be converted to an Error. Before this commit
  it was a Note for blobs and a Warning for all other data types.
This commit is contained in:
Sergei Golubchik
2021-01-10 00:57:02 +01:00
parent 6f707430e5
commit 0d8bd7cc3a
23 changed files with 69 additions and 43 deletions

View File

@@ -407,10 +407,10 @@ ROW_FORMAT=DYNAMIC;
SET sql_mode='';
create index idx1 on worklog5743(a2);
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx2 on worklog5743(a3);
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743(a4);
show warnings;
Level Code Message
@@ -419,7 +419,7 @@ create index idx4 on worklog5743(a1, a2);
ERROR 42000: Specified key was too long; max key length is 3072 bytes
show warnings;
Level Code Message
Error 1071 Specified key was too long; max key length is 3072 bytes
Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1071 Specified key was too long; max key length is 3072 bytes
create index idx5 on worklog5743(a1, a5);
ERROR 42000: Specified key was too long; max key length is 3072 bytes

View File

@@ -1221,7 +1221,7 @@ DROP INDEX prefix_idx ON worklog5743;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (4000));
Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
Note 1071 Specified key was too long; max key length is 3072 bytes
SET sql_mode = default;
INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743;