Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
N/A
-
None
Description
--source include/have_innodb.inc
|
|
create or replace table t (a varchar(64)) engine=InnoDB; |
insert into t values ('foo'),(null); |
--error WARN_DATA_TRUNCATED
|
alter table t add primary key(a), algorithm=INPLACE; |
|
get diagnostics condition 1 @n= row_number, @m= message_text;
|
select @n, @m; |
Note: algorithm=INPLACE is default for this ALTER, I only specify it for clarity.
bb-10.7-row_number cb9002bee |
MariaDB [test]> get diagnostics condition 1 @n= row_number, @m= message_text; select @n, @m; |
Query OK, 0 rows affected (0.000 sec) |
|
+------+----------------------------------------+ |
| @n | @m |
|
+------+----------------------------------------+ |
| 0 | Data truncated for column 'a' at row 2 | |
+------+----------------------------------------+ |
1 row in set (0.000 sec) |
If the algorithm is set to COPY (or if the table is MyISAM, then COPY is default), then ROW_NUMBER is set as expected.
There are likely to be many places where inplace ALTER bypasses ROW_NUMBER initialization; the problem here is that the value ends up to be different from the error message.
Attachments
Issue Links
- is caused by
-
MDEV-10075 Provide index of error causing error in array INSERT
- Closed