MDEV-35723: applying non-zero offset to null pointer in INSERT
row_mysql_read_blob_ref(): Correctly handle what Field_blob::store() generates for length=0.
This commit is contained in:
parent
df602ff7fa
commit
f521b8ac21
@ -3337,3 +3337,9 @@ Table Op Msg_type Msg_text
|
|||||||
test.t1 check status OK
|
test.t1 check status OK
|
||||||
ALTER TABLE t1 FORCE;
|
ALTER TABLE t1 FORCE;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-35723: applying zero offset to null pointer on INSERT
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(c TEXT(1) NOT NULL, INDEX (c)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 SET c='';
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -2605,3 +2605,10 @@ CHECK TABLE t1;
|
|||||||
ALTER TABLE t1 FORCE;
|
ALTER TABLE t1 FORCE;
|
||||||
# Cleanup
|
# Cleanup
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-35723: applying zero offset to null pointer on INSERT
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1(c TEXT(1) NOT NULL, INDEX (c)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 SET c='';
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -244,6 +244,14 @@ row_mysql_read_blob_ref(
|
|||||||
|
|
||||||
*len = mach_read_from_n_little_endian(ref, col_len - 8);
|
*len = mach_read_from_n_little_endian(ref, col_len - 8);
|
||||||
|
|
||||||
|
if (!*len) {
|
||||||
|
/* Field_blob::store() if (!length) would encode both
|
||||||
|
the length and the pointer in the same area. An empty
|
||||||
|
string must be a valid (nonnull) pointer in the
|
||||||
|
collation functions that cmp_data() may invoke. */
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&data, ref + col_len - 8, sizeof data);
|
memcpy(&data, ref + col_len - 8, sizeof data);
|
||||||
|
|
||||||
return(data);
|
return(data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user