Bug #38518 REPLACE on NDB tables does not consider DEFAULT values
Description:
When you use the REPLACE statement on a NDB table, the DEFAULT value is not used. This behaviour is different from the use of REPLACE with other storage engines and with INSERT on a NDB table. Migrations from other storage engines to NDB are not possible because of this bug.
How to repeat:
CREATE TABLE callerid ( cardid varchar(20) NOT NULL DEFAULT '', callerid varchar(20) NOT NULL DEFAULT '', usertype varchar(10) DEFAULT 'XXX', KEY (cardid, usertype) ) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
replace into callerid (cardid,callerid) values ('7225824','01274449137');
select * from callerid;
+---------+-------------+----------+
| cardid | callerid | usertype |
+---------+-------------+----------+
| 7225824 | 01274449137 | NULL |
+---------+-------------+----------+
1 row in set (0.00 sec)
If you execute the same statement with InnoDB, the result is:
select * from callerid;
+---------+-------------+----------+
| cardid | callerid | usertype |
+---------+-------------+----------+
| 7225824 | 01274449137 | XXX |
+---------+-------------+----------+
1 row in set (0.00 sec)
The same result on a NDB table can be obtained with an INSERT:
insert into callerid (cardid, callerid) values ('7225825','01274449136');
Query OK, 1 row affected (0.00 sec)
select * from callerid;
+---------+-------------+----------+
| cardid | callerid | usertype |
+---------+-------------+----------+
| 7225824 | 01274449137 | XXX |
+---------+-------------+----------+
1 row in set (0.00 sec)
Suggested fix:
Make REPLACE consistent with INSERT and with other storage engines.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: When you use the REPLACE statement on a NDB table, the DEFAULT value is not used. This behaviour is different from the use of REPLACE with other storage engines and with INSERT on a NDB table. Migrations from other storage engines to NDB are not possible because of this bug. How to repeat: CREATE TABLE callerid ( cardid varchar(20) NOT NULL DEFAULT '', callerid varchar(20) NOT NULL DEFAULT '', usertype varchar(10) DEFAULT 'XXX', KEY (cardid, usertype) ) ENGINE=ndbcluster DEFAULT CHARSET=utf8; replace into callerid (cardid,callerid) values ('7225824','01274449137'); select * from callerid; +---------+-------------+----------+ | cardid | callerid | usertype | +---------+-------------+----------+ | 7225824 | 01274449137 | NULL | +---------+-------------+----------+ 1 row in set (0.00 sec) If you execute the same statement with InnoDB, the result is: select * from callerid; +---------+-------------+----------+ | cardid | callerid | usertype | +---------+-------------+----------+ | 7225824 | 01274449137 | XXX | +---------+-------------+----------+ 1 row in set (0.00 sec) The same result on a NDB table can be obtained with an INSERT: insert into callerid (cardid, callerid) values ('7225825','01274449136'); Query OK, 1 row affected (0.00 sec) select * from callerid; +---------+-------------+----------+ | cardid | callerid | usertype | +---------+-------------+----------+ | 7225824 | 01274449137 | XXX | +---------+-------------+----------+ 1 row in set (0.00 sec) Suggested fix: Make REPLACE consistent with INSERT and with other storage engines.