mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Bug #14514 Creating table with packed key fails silently
- Backport from 5.0
This commit is contained in:
parent
133c00beb4
commit
9301123eb3
5 changed files with 15 additions and 3 deletions
|
@ -231,6 +231,7 @@ enum ha_base_keytype {
|
||||||
#define HA_OPTION_CHECKSUM 32
|
#define HA_OPTION_CHECKSUM 32
|
||||||
#define HA_OPTION_DELAY_KEY_WRITE 64
|
#define HA_OPTION_DELAY_KEY_WRITE 64
|
||||||
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
|
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
|
||||||
|
#define HA_OPTION_CREATE_FROM_ENGINE 256
|
||||||
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
|
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
|
||||||
#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
|
#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
|
||||||
|
|
||||||
|
@ -241,7 +242,6 @@ enum ha_base_keytype {
|
||||||
#define HA_CREATE_TMP_TABLE 4
|
#define HA_CREATE_TMP_TABLE 4
|
||||||
#define HA_CREATE_CHECKSUM 8
|
#define HA_CREATE_CHECKSUM 8
|
||||||
#define HA_CREATE_DELAY_KEY_WRITE 64
|
#define HA_CREATE_DELAY_KEY_WRITE 64
|
||||||
#define HA_CREATE_FROM_ENGINE 128
|
|
||||||
|
|
||||||
/* Bits in flag to _status */
|
/* Bits in flag to _status */
|
||||||
|
|
||||||
|
|
|
@ -667,3 +667,7 @@ counter datavalue
|
||||||
57 newval
|
57 newval
|
||||||
58 newval
|
58 newval
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||||
|
select * from t1;
|
||||||
|
b
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -606,4 +606,12 @@ select * from t1 order by counter;
|
||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#14514 Creating table with packed key fails silently
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
|
||||||
|
select * from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
|
@ -3711,7 +3711,7 @@ int ha_ndbcluster::create(const char *name,
|
||||||
const void *data, *pack_data;
|
const void *data, *pack_data;
|
||||||
const char **key_names= form->keynames.type_names;
|
const char **key_names= form->keynames.type_names;
|
||||||
char name2[FN_HEADLEN];
|
char name2[FN_HEADLEN];
|
||||||
bool create_from_engine= (info->table_options & HA_CREATE_FROM_ENGINE);
|
bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
|
||||||
|
|
||||||
DBUG_ENTER("create");
|
DBUG_ENTER("create");
|
||||||
DBUG_PRINT("enter", ("name: %s", name));
|
DBUG_PRINT("enter", ("name: %s", name));
|
||||||
|
|
|
@ -1382,7 +1382,7 @@ int ha_create_table_from_engine(THD* thd,
|
||||||
DBUG_RETURN(3);
|
DBUG_RETURN(3);
|
||||||
|
|
||||||
update_create_info_from_table(&create_info, &table);
|
update_create_info_from_table(&create_info, &table);
|
||||||
create_info.table_options|= HA_CREATE_FROM_ENGINE;
|
create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE;
|
||||||
|
|
||||||
if (lower_case_table_names == 2 &&
|
if (lower_case_table_names == 2 &&
|
||||||
!(table.file->table_flags() & HA_FILE_BASED))
|
!(table.file->table_flags() & HA_FILE_BASED))
|
||||||
|
|
Loading…
Reference in a new issue