|
--source suite/federated/have_federatedx.inc
|
|
create table t (pk int primary key);
|
--eval create table tfed engine=FEDERATED connection='mysql://root@localhost:$MASTER_MYPORT/test/t'
|
--error ER_DUP_KEY
|
insert into tfed values (1),(2),(1);
|
get diagnostics condition 1 @val = error_index;
|
select @val;
|
|
# Cleanup
|
drop table tfed, t;
|
|
10.7 225564993
|
MariaDB [test]> insert into tfed values (1),(2),(1);
|
ERROR 1022 (23000): Can't write; duplicate key in table 'tfed'
|
MariaDB [test]> get diagnostics condition 1 @val = error_index;
|
Query OK, 0 rows affected (0.001 sec)
|
|
MariaDB [test]> select @val;
|
+------+
|
| @val |
|
+------+
|
| 4 |
|
+------+
|
1 row in set (0.001 sec)
|
The expected result is obviously 3.
|