Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
While INSERT, UPDATE, DELETE and LOAD DATA INFILE all support
IGNORE construct, REPLACE does not have this option.
MariaDB [test]> select @@sql_mode;
|
+---------------------+
|
| @@sql_mode |
|
+---------------------+
|
| STRICT_TRANS_TABLES |
|
+---------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> create table t1(i int primary key, j varchar(10)) engine=innodb;
|
Query OK, 0 rows affected (0.03 sec)
|
|
MariaDB [test]> insert into t1 values('aaa', 'bbb');
|
ERROR 1366 (22007): Incorrect integer value: 'aaa' for column 'i' at row 1
|
|
MariaDB [test]> insert into t1 values('aaa', 'bbb');
|
ERROR 1366 (22007): Incorrect integer value: 'aaa' for column 'i' at row 1
|
|
MariaDB [test]> insert ignore into t1 values('aaa', 'bbb');
|
Query OK, 1 row affected, 1 warning (0.01 sec)
|
|
MariaDB [test]> show warnings;
|
+---------+------+--------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+--------------------------------------------------------+
|
| Warning | 1366 | Incorrect integer value: 'aaa' for column 'i' at row 1 |
|
+---------+------+--------------------------------------------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> select * from t1;
|
+---+------+
|
| i | j |
|
+---+------+
|
| 0 | bbb |
|
+---+------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> replace into t1 values('aaa', 'bbb');
|
ERROR 1366 (22007): Incorrect integer value: 'aaa' for column 'i' at row 1
|
|
MariaDB [test]> replace ignore into t1 values('aaa', 'bbb');
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ignore into t1 values('aaa', 'bbb')' at line 1
|
Attachments
Issue Links
- relates to
-
MDEV-7635 update defaults and simplify mysqld config parameters
- Closed