Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
None
-
None
-
None
Description
First, we insert a value into column col1 (and check that it's inserted correctly). Then we add a column with a long name, and expectedly get a warning about truncated data. But then we try to read the value of 'col1' again and find out that it's not the same as it used to be.
drop table if exists t1; |
CREATE TABLE t1 (f1 tinyblob); |
INSERT INTO t1 VALUES (COLUMN_CREATE('col1', REPEAT('a',30))); |
select column_get(f1,'col1' as char(30)) from t1; |
# +-----------------------------------+ |
# | column_get(f1,'col1' as char(30)) | |
# +-----------------------------------+ |
# | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
# +-----------------------------------+ |
|
UPDATE t1 SET f1 = COLUMN_ADD( f1, REPEAT('c',211), 'val3' ); |
show warnings;
|
# +---------+------+-----------------------------------------+ |
# | Level | Code | Message | |
# +---------+------+-----------------------------------------+ |
# | Warning | 1265 | Data truncated for column 'f1' at row 1 | |
# +---------+------+-----------------------------------------+ |
|
select column_get(f1,'col1' as char(30)) from t1; |
# +-----------------------------------+ |
# | column_get(f1,'col1' as char(30)) | |
# +-----------------------------------+ |
# | aaaaaaaaaaaaaaaaaaaaaaaa¦¦¦¦¦¦ |
|
# +-----------------------------------+ |
|
select column_get(f1,'col1' as char(30)) = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as test from t1; |
# +------+ |
# | test |
|
# +------+ |
# | 0 |
|
# +------+ |
Test case (same as above, but only essential commands)
drop table if exists t1; |
CREATE TABLE t1 (f1 tinyblob); |
INSERT INTO t1 VALUES (COLUMN_CREATE('col1', REPEAT('a',30))); |
UPDATE t1 SET f1 = COLUMN_ADD( f1, REPEAT('c',211), 'val3' ); |
select column_get(f1,'col1' as char(30)) from t1; |
Attachments
Issue Links
- relates to
-
MDEV-377 Name support for dynamic columns
- Closed