Skip to content

Commit 09c5bbf

Browse files
committed
Merge 10.0 into 10.1
2 parents 682c3bf + 40088bf commit 09c5bbf

File tree

13 files changed

+147
-213
lines changed

13 files changed

+147
-213
lines changed

mysql-test/suite/innodb/r/innodb-autoinc.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,3 +1348,15 @@ t CREATE TABLE `t` (
13481348
KEY `i` (`i`)
13491349
) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=latin1
13501350
DROP TABLE t;
1351+
#
1352+
# MDEV-14008 Assertion failing: `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())
1353+
#
1354+
SET sql_mode=STRICT_ALL_TABLES;
1355+
CREATE TABLE t1 (
1356+
c1 DOUBLE NOT NULL PRIMARY KEY AUTO_INCREMENT
1357+
) ENGINE=InnoDB AUTO_INCREMENT=10000000000000000000;
1358+
INSERT INTO t1 VALUES ();
1359+
SELECT * FROM t1;
1360+
c1
1361+
1e19
1362+
DROP TABLE t1;

mysql-test/suite/innodb/t/innodb-autoinc.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,3 +680,15 @@ INSERT INTO t VALUES (NULL);
680680
SELECT * FROM t;
681681
SHOW CREATE TABLE t;
682682
DROP TABLE t;
683+
684+
--echo #
685+
--echo # MDEV-14008 Assertion failing: `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())
686+
--echo #
687+
688+
SET sql_mode=STRICT_ALL_TABLES;
689+
CREATE TABLE t1 (
690+
c1 DOUBLE NOT NULL PRIMARY KEY AUTO_INCREMENT
691+
) ENGINE=InnoDB AUTO_INCREMENT=10000000000000000000;
692+
INSERT INTO t1 VALUES ();
693+
SELECT * FROM t1;
694+
DROP TABLE t1;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CREATE TABLE t1 (i INT) ENGINE=MYISAM
2+
PARTITION BY LIST(i) (
3+
PARTITION p0 VALUES IN (1),
4+
PARTITION p1 VALUES IN (2)
5+
);
6+
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
7+
ALTER TABLE t1 DROP PARTITION p1;
8+
SELECT * FROM t1;
9+
i
10+
DROP TABLE t1;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
3+
#
4+
5+
--source include/have_partition.inc
6+
7+
CREATE TABLE t1 (i INT) ENGINE=MYISAM
8+
PARTITION BY LIST(i) (
9+
PARTITION p0 VALUES IN (1),
10+
PARTITION p1 VALUES IN (2)
11+
);
12+
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
13+
ALTER TABLE t1 DROP PARTITION p1;
14+
SELECT * FROM t1;
15+
16+
# Cleanup
17+
DROP TABLE t1;

sql/field.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4729,15 +4729,15 @@ double Field_double::val_real(void)
47294729
return j;
47304730
}
47314731

4732-
longlong Field_double::val_int(void)
4732+
longlong Field_double::val_int_from_real(bool want_unsigned_result)
47334733
{
47344734
ASSERT_COLUMN_MARKED_FOR_READ;
47354735
double j;
47364736
longlong res;
47374737
bool error;
47384738
float8get(j,ptr);
47394739

4740-
res= double_to_longlong(j, 0, &error);
4740+
res= double_to_longlong(j, want_unsigned_result, &error);
47414741
if (error)
47424742
{
47434743
THD *thd= get_thd();

sql/field.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,10 @@ class Field: public Value_source
745745
{ return store(ls->str, ls->length, cs); }
746746
virtual double val_real(void)=0;
747747
virtual longlong val_int(void)=0;
748+
virtual ulonglong val_uint(void)
749+
{
750+
return (ulonglong) val_int();
751+
}
748752
virtual bool val_bool(void)= 0;
749753
virtual my_decimal *val_decimal(my_decimal *);
750754
inline String *val_str(String *str) { return val_str(str, str); }
@@ -1999,6 +2003,7 @@ class Field_float :public Field_real {
19992003

20002004

20012005
class Field_double :public Field_real {
2006+
longlong val_int_from_real(bool want_unsigned_result);
20022007
public:
20032008
Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
20042009
uchar null_bit_arg,
@@ -2025,7 +2030,8 @@ class Field_double :public Field_real {
20252030
int store(longlong nr, bool unsigned_val);
20262031
int reset(void) { bzero(ptr,sizeof(double)); return 0; }
20272032
double val_real(void);
2028-
longlong val_int(void);
2033+
longlong val_int(void) { return val_int_from_real(false); }
2034+
ulonglong val_uint(void) { return (ulonglong) val_int_from_real(true); }
20292035
String *val_str(String*,String *);
20302036
bool send_binary(Protocol *protocol);
20312037
int cmp(const uchar *,const uchar *);

sql/handler.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,13 @@ struct HA_CREATE_INFO: public Table_scope_and_contents_source_st,
17641764
used_fields|= (HA_CREATE_USED_CHARSET | HA_CREATE_USED_DEFAULT_CHARSET);
17651765
return false;
17661766
}
1767+
ulong table_options_with_row_type()
1768+
{
1769+
if (row_type == ROW_TYPE_DYNAMIC || row_type == ROW_TYPE_PAGE)
1770+
return table_options | HA_OPTION_PACK_RECORD;
1771+
else
1772+
return table_options;
1773+
}
17671774
};
17681775

17691776

sql/sql_partition.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6831,10 +6831,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
68316831
lpt->part_info= part_info;
68326832
lpt->alter_info= alter_info;
68336833
lpt->create_info= create_info;
6834-
lpt->db_options= create_info->table_options;
6835-
if (create_info->row_type != ROW_TYPE_FIXED &&
6836-
create_info->row_type != ROW_TYPE_DEFAULT)
6837-
lpt->db_options|= HA_OPTION_PACK_RECORD;
6834+
lpt->db_options= create_info->table_options_with_row_type();
68386835
lpt->table= table;
68396836
lpt->key_info_buffer= 0;
68406837
lpt->key_count= 0;

sql/sql_table.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,10 +4414,7 @@ handler *mysql_create_frm_image(THD *thd,
44144414

44154415
set_table_default_charset(thd, create_info, (char*) db);
44164416

4417-
db_options= create_info->table_options;
4418-
if (create_info->row_type == ROW_TYPE_DYNAMIC ||
4419-
create_info->row_type == ROW_TYPE_PAGE)
4420-
db_options|= HA_OPTION_PACK_RECORD;
4417+
db_options= create_info->table_options_with_row_type();
44214418

44224419
if (!(file= get_new_handler((TABLE_SHARE*) 0, thd->mem_root,
44234420
create_info->db_type)))

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8297,7 +8297,7 @@ ha_innobase::write_row(
82978297
table->next_number_field);
82988298

82998299
/* Get the value that MySQL attempted to store in the table.*/
8300-
auto_inc = table->next_number_field->val_int();
8300+
auto_inc = table->next_number_field->val_uint();
83018301

83028302
switch (error) {
83038303
case DB_DUPLICATE_KEY:
@@ -8891,7 +8891,7 @@ ha_innobase::update_row(
88918891
ulonglong auto_inc;
88928892
ulonglong col_max_value;
88938893

8894-
auto_inc = table->next_number_field->val_int();
8894+
auto_inc = table->next_number_field->val_uint();
88958895

88968896
/* We need the upper limit of the col type to check for
88978897
whether we update the table autoinc counter or not. */

0 commit comments

Comments
 (0)