Commit d137b4db authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5800 MyISAM support for indexed vcols

* don't issue an error for ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
* support keyread on vcols
* callback into the server to compute vcol values from mi_check/mi_repair
* DMLs just work. Automatically.
parent a418c992
...@@ -58,6 +58,7 @@ extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1, ...@@ -58,6 +58,7 @@ extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1, extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
const MY_BITMAP *map2); const MY_BITMAP *map2);
extern my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array, extern my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array,
......
...@@ -58,6 +58,7 @@ typedef enum ...@@ -58,6 +58,7 @@ typedef enum
MI_STATS_METHOD_IGNORE_NULLS MI_STATS_METHOD_IGNORE_NULLS
} enum_handler_stats_method; } enum_handler_stats_method;
struct st_myisam_info;
typedef struct st_handler_check_param typedef struct st_handler_check_param
{ {
...@@ -114,6 +115,8 @@ typedef struct st_handler_check_param ...@@ -114,6 +115,8 @@ typedef struct st_handler_check_param
uint progress_counter; /* How often to call _report_progress() */ uint progress_counter; /* How often to call _report_progress() */
ulonglong progress, max_progress; ulonglong progress, max_progress;
int (*fix_record)(struct st_myisam_info *info, uchar *record, int keynum);
mysql_mutex_t print_msg_mutex; mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock; my_bool need_print_msg_lock;
myf malloc_flags; myf malloc_flags;
......
...@@ -399,6 +399,7 @@ INSERT INTO t VALUES (); ...@@ -399,6 +399,7 @@ INSERT INTO t VALUES ();
UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2; UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2;
SELECT * FROM t; SELECT * FROM t;
SELECT gc FROM t; SELECT gc FROM t;
CHECK TABLE t;
DROP TABLE t; DROP TABLE t;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
if (!$support_virtual_index) { if (!$support_virtual_index) {
let $skip_spatial_index_check=1; let $skip_spatial_index_check=1;
let $skip_foreign_key_check=1;
} }
--echo # - UNIQUE KEY --echo # - UNIQUE KEY
...@@ -118,10 +119,10 @@ drop table t1; ...@@ -118,10 +119,10 @@ drop table t1;
if (!$skip_spatial_index_check) if (!$skip_spatial_index_check)
{ {
--echo # Error "All parts of a SPATIAL index must be geometrical" --echo # Error "All parts of a SPATIAL index must be geometrical"
--error 1687 --error ER_WRONG_ARGUMENTS
create table t1 (a int, b int generated always as (a+1) stored, spatial index (b)); create table t1 (a int, b int generated always as (a+1) stored, spatial index (b));
create table t1 (a int, b int generated always as (a+1) stored); create table t1 (a int, b int generated always as (a+1) stored);
--error 1687 --error ER_WRONG_ARGUMENTS
alter table t1 add spatial index (b); alter table t1 add spatial index (b);
drop table t1; drop table t1;
} }
...@@ -148,7 +149,7 @@ alter table t1 add foreign key (b) references t2(a) on update cascade; ...@@ -148,7 +149,7 @@ alter table t1 add foreign key (b) references t2(a) on update cascade;
alter table t1 add foreign key (b) references t2(a) on delete set null; alter table t1 add foreign key (b) references t2(a) on delete set null;
drop table t1; drop table t1;
if($support_virtual_index) if(!$skip_foreign_key_check)
{ {
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t1 (a int, b int generated always as (a+1) virtual, create table t1 (a int, b int generated always as (a+1) virtual,
...@@ -317,7 +318,7 @@ CREATE TABLE t1 ( ...@@ -317,7 +318,7 @@ CREATE TABLE t1 (
UNIQUE KEY col_int_key (col_int_key) UNIQUE KEY col_int_key (col_int_key)
); );
ALTER TABLE t1 add unique index idx(pk), algorithm=inplace; ALTER TABLE t1 add unique index idx(pk);
DESC t1; DESC t1;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -49,13 +49,21 @@ alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT ...@@ -49,13 +49,21 @@ alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT
ERROR 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 'AUTO_INCREMENT' at line 1 ERROR 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 'AUTO_INCREMENT' at line 1
drop table t1; drop table t1;
# [PRIMARY] KEY # [PRIMARY] KEY
create table t1 (a int, b int generated always as (a+1) virtual key);
ERROR 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 'key)' at line 1
create table t1 (a int, b int generated always as (a+1) stored key); create table t1 (a int, b int generated always as (a+1) stored key);
ERROR 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 'key)' at line 1 ERROR 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 'key)' at line 1
create table t1 (a int, b int generated always as (a+1) virtual primary key);
ERROR 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 'primary key)' at line 1
create table t1 (a int, b int generated always as (a+1) stored primary key); create table t1 (a int, b int generated always as (a+1) stored primary key);
ERROR 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 'primary key)' at line 1 ERROR 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 'primary key)' at line 1
create table t1 (a int); create table t1 (a int);
alter table t1 add column b int generated always as (a+1) virtual key;
ERROR 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 'key' at line 1
alter table t1 add column b int generated always as (a+1) stored key; alter table t1 add column b int generated always as (a+1) stored key;
ERROR 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 'key' at line 1 ERROR 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 'key' at line 1
alter table t1 add column c int generated always as (a+2) virtual primary key;
ERROR 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 'primary key' at line 1
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -265,14 +273,6 @@ a b c ...@@ -265,14 +273,6 @@ a b c
1 -1 0 1 -1 0
2 -2 -1 2 -2 -1
drop table t1,tt; drop table t1,tt;
# Bug#20769299: INCORRECT KEY ERROR WHEN TRYING TO CREATE INDEX ON
# VIRTUAL GC FOR MYISAM
CREATE TABLE A (
pk INTEGER,
col_int_nokey INTEGER,
col_int_key INTEGER GENERATED ALWAYS AS (pk + col_int_nokey) VIRTUAL, KEY
(col_int_key));
ERROR HY000: Key/Index cannot be defined on a non-stored computed column
# Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED: # Bug#20745142: GENERATED COLUMNS: ASSERTION FAILED:
# THD->CHANGE_LIST.IS_EMPTY() # THD->CHANGE_LIST.IS_EMPTY()
# #
...@@ -369,6 +369,36 @@ SELECT * FROM t1; ...@@ -369,6 +369,36 @@ SELECT * FROM t1;
c2 c1 5 c2 c1 5
2 1 5 2 1 5
DROP TABLE t1, t2; DROP TABLE t1, t2;
# Bug#21074624:i WL8149:SIG 11 INNOBASE_GET_COMPUTED_VALUE |
# INNOBASE/HANDLER/HA_INNODB.CC:19082
CREATE TABLE t1 (
col1 int(11) NOT NULL,
col2 int(11) DEFAULT NULL,
col3 int(11) NOT NULL,
col4 int(11) DEFAULT NULL,
col5 int(11) GENERATED ALWAYS AS (col2 % col4) VIRTUAL,
col6 int(11) GENERATED ALWAYS AS (col3 + col3) VIRTUAL,
col7 int(11) GENERATED ALWAYS AS (col5 / col5) VIRTUAL,
col8 int(11) GENERATED ALWAYS AS (col6 / col5) VIRTUAL,
col9 text,
extra int(11) DEFAULT NULL,
KEY idx (col5)
);
INSERT INTO t1(col1,col2,col3,col4,col9,extra)
VALUES(0,6,3,4,REPEAT(4,1000),0);
ALTER TABLE t1 DROP COLUMN col1;
DROP TABLE t1;
# Bug#21390605:VALGRIND ERROR ON DELETE FROM TABLE CONTAINING
# AN INDEXED VIRTUAL COLUMN
CREATE TABLE t1 (
a INTEGER,
b INTEGER GENERATED ALWAYS AS (a) VIRTUAL,
c INTEGER GENERATED ALWAYS AS (b) VIRTUAL,
INDEX idx (b,c)
);
INSERT INTO t1 (a) VALUES (42);
DELETE FROM t1 WHERE c = 42;
DROP TABLE t1;
# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES # Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES
# IN FIND_FIELD_IN_TABLE # IN FIND_FIELD_IN_TABLE
# #
...@@ -459,6 +489,12 @@ info: Records: 1 Duplicates: 0 Warnings: 0 ...@@ -459,6 +489,12 @@ info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t CHANGE dd d varchar(10); ALTER TABLE t CHANGE dd d varchar(10);
affected rows: 1 affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0 info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t ADD INDEX idx(c), ADD INDEX idx1(d);
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t DROP INDEX idx, DROP INDEX idx1;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
DROP TABLE t; DROP TABLE t;
# Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF # Bug#21854004: GCOLS:INNODB: FAILING ASSERTION: I < TABLE->N_DEF
CREATE TABLE t1( CREATE TABLE t1(
...@@ -487,19 +523,34 @@ col1 col2 col3 col4 vgc1 sgc1 ...@@ -487,19 +523,34 @@ col1 col2 col3 col4 vgc1 sgc1
2 20 200 NULL 4000 0 2 20 200 NULL 4000 0
ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL; ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL;
ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED;
ALTER TABLE t1 ADD INDEX vgc1 (vgc1);
ALTER TABLE t1 ADD INDEX sgc1 (sgc1); ALTER TABLE t1 ADD INDEX sgc1 (sgc1);
ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL;
SELECT * FROM t1 order by col1;
col1 col2 col3 col4 vgc1 sgc1
1 10 100 NULL 1000 -90
2 20 200 NULL 4000 -180
SELECT vgc1 FROM t1 order by vgc1;
vgc1
1000
4000
ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED;
SELECT * FROM t1 order by col1; SELECT * FROM t1 order by col1;
col1 col2 col3 col4 vgc1 sgc1 col1 col2 col3 col4 vgc1 sgc1
1 10 100 NULL 110 0 1 10 100 NULL 1000 0
2 20 200 NULL 220 0 2 20 200 NULL 4000 0
SELECT sgc1 FROM t1 order by sgc1; SELECT sgc1 FROM t1 order by sgc1;
sgc1 sgc1
0 0
0 0
ALTER TABLE t1 DROP INDEX vgc1;
ALTER TABLE t1 DROP INDEX sgc1; ALTER TABLE t1 DROP INDEX sgc1;
ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 + col3) VIRTUAL;
ALTER TABLE t1 ADD UNIQUE INDEX vgc1 (vgc1);
ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED; ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 - col3) STORED;
ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1); ALTER TABLE t1 ADD UNIQUE INDEX sgc1 (sgc1);
ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 / col3) VIRTUAL;
ERROR 23000: Duplicate entry '0' for key 'vgc1'
ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED; ALTER TABLE t1 MODIFY COLUMN sgc1 INTEGER AS (col2 / col3) STORED;
ERROR 23000: Duplicate entry '0' for key 'sgc1' ERROR 23000: Duplicate entry '0' for key 'sgc1'
ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL; ALTER TABLE t1 MODIFY COLUMN vgc1 INTEGER AS (col2 * col3) VIRTUAL;
...@@ -536,9 +587,72 @@ col1 col2 col3 col4 vgc1 sgc1 ...@@ -536,9 +587,72 @@ col1 col2 col3 col4 vgc1 sgc1
2 20 200 222 4000 4000 2 20 200 222 4000 4000
DROP TABLE t1; DROP TABLE t1;
# #
# bug#22018979: RECORD NOT FOUND ON UPDATE,
# VIRTUAL COLUMN, ASSERTION 0
SET @sql_mode_save= @@sql_mode;
SET sql_mode= 'ANSI';
CREATE TABLE t1 (
a INT,
b VARCHAR(10),
c CHAR(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL,
PRIMARY KEY (a),
KEY c(c)
);
INSERT INTO t1(a, b) values(1, 'bbbb'), (2, 'cc');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) NOT NULL,
"b" varchar(10) DEFAULT NULL,
"c" char(3) AS (substr(b,1,3)) VIRTUAL,
PRIMARY KEY ("a"),
KEY "c" ("c")
)
SELECT * FROM t1 order by a;
a b c
1 bbbb bbb
2 cc cc
SET sql_mode= '';
FLUSH TABLE t1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(10) DEFAULT NULL,
`c` char(3) AS (substr(b,1,3)) VIRTUAL,
PRIMARY KEY (`a`),
KEY `c` (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t1 order by a;
a b c
1 bbbb bbb
2 cc cc
DELETE FROM t1 where a= 2;
SET sql_mode= @sql_mode_save;
DROP TABLE t1;
#
# Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE # Bug#22680839: DEFAULT IS NOT DETERMINISTIC AND SHOULD NOT BE
# ALLOWED IN GENERATED COLUMNS # ALLOWED IN GENERATED COLUMNS
# #
CREATE TABLE tzz(a INT DEFAULT 5,
gc1 INT AS (a+DEFAULT(a)) VIRTUAL,
gc2 INT AS (a+DEFAULT(a)) STORED,
KEY k1(gc1));
INSERT INTO tzz(A) VALUES (1);
SELECT * FROM tzz;
a gc1 gc2
1 6 6
SELECT gc1 FROM tzz;
gc1
6
ALTER TABLE tzz MODIFY COLUMN a INT DEFAULT 6;
SELECT * FROM tzz;
a gc1 gc2
1 7 7
SELECT gc1 FROM tzz;
gc1
7
DROP TABLE tzz;
# Test 1: ALTER DEFAULT # Test 1: ALTER DEFAULT
# #
CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5, CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 5,
...@@ -546,11 +660,11 @@ b INT AS (1 + DEFAULT(a)) STORED, ...@@ -546,11 +660,11 @@ b INT AS (1 + DEFAULT(a)) STORED,
c INT AS (1 + DEFAULT(a)) VIRTUAL); c INT AS (1 + DEFAULT(a)) VIRTUAL);
INSERT INTO t1 VALUES (); INSERT INTO t1 VALUES ();
ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7; ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 7;
affected rows: 0 affected rows: 1
info: Records: 0 Duplicates: 0 Warnings: 0 info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8; ALTER TABLE t1 MODIFY COLUMN a INT DEFAULT 8;
affected rows: 0 affected rows: 1
info: Records: 0 Duplicates: 0 Warnings: 0 info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5; ALTER TABLE t1 CHANGE COLUMN a a DOUBLE DEFAULT 5;
affected rows: 1 affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0 info: Records: 1 Duplicates: 0 Warnings: 0
......
...@@ -357,6 +357,26 @@ select * from t1; ...@@ -357,6 +357,26 @@ select * from t1;
a b c d a b c d
set sql_warnings = 0; set sql_warnings = 0;
drop table t1; drop table t1;
Bug#20797344: WL#8149: ALLOCATED SPACE FOR INDEXED BLOB VGC CAN BE
OVERWRITTEN FOR UPDATE
#
CREATE TABLE t (a varchar(100), b blob,
c blob GENERATED ALWAYS AS (concat(a,b)) VIRTUAL,
d blob GENERATED ALWAYS AS (b) VIRTUAL,
e int(11) GENERATED ALWAYS AS (10) VIRTUAL,
h int(11) NOT NULL, PRIMARY KEY (h), key(c(20)));
INSERT INTO t(a,b,h) VALUES('aaaaaaa','1111111', 11);
INSERT INTO t(a,b,h) VALUES('bbbbbbb','2222222', 22);
SELECT c FROM t;
c
aaaaaaa1111111
bbbbbbb2222222
UPDATE t SET a='ccccccc';
SELECT c FROM t;
c
ccccccc1111111
ccccccc2222222
DROP TABLE t;
# Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET || # Bug#21081742: ASSERTION !TABLE || (!TABLE->WRITE_SET ||
# BITMAP_IS_SET(TABLE->WRITE_SET # BITMAP_IS_SET(TABLE->WRITE_SET
# #
...@@ -413,6 +433,21 @@ SELECT * FROM t; ...@@ -413,6 +433,21 @@ SELECT * FROM t;
x y gc x y gc
2 1 3 2 1 3
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (
x INT, y INT, gc INT GENERATED ALWAYS AS (x+1), KEY (x,gc)
);
INSERT INTO t VALUES ();
UPDATE t t1, t t2 SET t1.x = 1, t2.y = 2;
SELECT * FROM t;
x y gc
1 2 2
SELECT gc FROM t;
gc
2
CHECK TABLE t;
Table Op Msg_type Msg_text
test.t check status OK
DROP TABLE t;
# stored # stored
CREATE TABLE C ( CREATE TABLE C (
col_varchar_nokey VARCHAR(1), col_varchar_nokey VARCHAR(1),
...@@ -474,6 +509,95 @@ SELECT * from C; ...@@ -474,6 +509,95 @@ SELECT * from C;
col_varchar_nokey col_varchar_key col_varchar_nokey col_varchar_key
a aa a aa
DROP TABLE C; DROP TABLE C;
# virtual, indexed
CREATE TABLE C (
col_varchar_nokey VARCHAR(1),
col_varchar_key VARCHAR(2) GENERATED ALWAYS AS
(CONCAT(col_varchar_nokey, col_varchar_nokey)) VIRTUAL,
KEY (col_varchar_key, col_varchar_nokey)
);
INSERT INTO C (col_varchar_nokey) VALUES ('c');
EXPLAIN UPDATE C AS OUTR1, C AS OUTR2
SET OUTR1.`col_varchar_nokey` = 'f',
OUTR2.`col_varchar_nokey` = "a";
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE OUTR1 system NULL NULL NULL NULL 1
1 SIMPLE OUTR2 system NULL NULL NULL NULL 1
UPDATE C AS OUTR1, C AS OUTR2
SET OUTR1.`col_varchar_nokey` = 'f',
OUTR2.`col_varchar_nokey` = "a";
SELECT * from C;
col_varchar_nokey col_varchar_key
a aa
DROP TABLE C;
#
# Bug #21530366 CRASH/ASSERTION, CORRUPTION WITH INDEXES +
# VIRTUAL COLUMNS, BLOB
#
CREATE TABLE t (
a INTEGER,
b BLOB GENERATED ALWAYS AS (a) VIRTUAL,
INDEX (b(57))
);
INSERT INTO t (a) VALUES (9);
UPDATE t SET a = 10;
DELETE FROM t WHERE a = 10;
DROP TABLE t;
# Bug#21807818: Generated columns not updated with empty insert list
CREATE TABLE t (
a BLOB GENERATED ALWAYS AS ('') VIRTUAL,
b TIMESTAMP(4) GENERATED ALWAYS AS ('') VIRTUAL,
KEY (a(183),b)
);
INSERT INTO t VALUES(), (), ();
DELETE IGNORE FROM t;
DROP TABLE t;
#
# Bug#22195458:GCOLS: ASSERTION 0 AND CORRUPTION...
#
CREATE TABLE t (
a INT,
b YEAR GENERATED ALWAYS AS ('a') VIRTUAL,
c YEAR GENERATED ALWAYS AS ('aaaa') VIRTUAL,
b1 YEAR GENERATED ALWAYS AS ('a') STORED,
c1 YEAR GENERATED ALWAYS AS ('aaaa') STORED,
UNIQUE(b),
UNIQUE(b1)
);
INSERT INTO t VALUES();
SELECT b from t;
b
2000
SELECT b1 from t;
b1
0000
SELECT * from t;
a b c b1 c1
NULL 2000 0000 0000 0000
DELETE FROM t;
CHECK TABLE t EXTENDED;
Table Op Msg_type Msg_text
test.t check status OK
DROP TABLE t;
# Bug#22195364:GCOLS: FAILING ASSERTION:
# DFIELD_IS_NULL(DFIELD2) || DFIELD2->DATA
CREATE TABLE t (
a INT,
c BLOB GENERATED ALWAYS AS ('') VIRTUAL,
UNIQUE KEY(c(1),a)
);
INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2;
SELECT * FROM t;
a c
1
INSERT INTO t(a) VALUES(1) ON DUPLICATE KEY UPDATE a=2;
SELECT * FROM t;
a c
2
SELECT GROUP_CONCAT(c ORDER BY c) FROM t;
GROUP_CONCAT(c ORDER BY c)
DROP TABLE t;
#Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE #Bug#21929967:GCOLS:GCOL VALUE CHANGES WHEN SESSION CHANGES SQL_MODE
CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL, CREATE TABLE t(c1 INT GENERATED ALWAYS AS (1) VIRTUAL,
c2 INT GENERATED ALWAYS AS(2) STORED); c2 INT GENERATED ALWAYS AS(2) STORED);
...@@ -515,6 +639,32 @@ i1 i2 ...@@ -515,6 +639,32 @@ i1 i2
5 10 5 10
5 10 5 10
DROP TABLE t1,t2; DROP TABLE t1,t2;
#
# Bug#22070021 GCOL:ASSERTION `!TABLE || (!TABLE->WRITE_SET ||
# BITMAP_IS_SET(TABLE->WRITE_SET,
#
CREATE TABLE t1(
c1 INT,
c2 INT GENERATED ALWAYS AS (c1 + c1) VIRTUAL,
KEY(c2)
);
INSERT INTO t1(c1) VALUES(0);
DELETE O1.* FROM t1 AS O1, t1 AS O2;
SELECT * FROM t1;
c1 c2
DROP TABLE t1;
#
# Bug#21944199 SIMPLE DELETE QUERY CAUSES INNODB: FAILING ASSERTION: 0
# & DATA CORRUPTION
#
CREATE TEMPORARY TABLE t1 (
a INTEGER NOT NULL,
b INTEGER GENERATED ALWAYS AS (a+1) VIRTUAL
);
INSERT INTO t1 (a) VALUES (0), (0), (0);
ALTER TABLE t1 ADD INDEX idx (b);
DELETE FROM t1;
DROP TEMPORARY TABLE t1;
DROP VIEW IF EXISTS v1,v2; DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3; DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p1;
......
...@@ -35,8 +35,7 @@ eval SET @@session.default_storage_engine = 'MyISAM'; ...@@ -35,8 +35,7 @@ eval SET @@session.default_storage_engine = 'MyISAM';
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines # Execute the tests to be applied to all storage engines
let $support_virtual_index= 0; let $support_virtual_index= 1;
let $support_virtual_foreign= 0;
--source suite/gcol/inc/gcol_column_def_options.inc --source suite/gcol/inc/gcol_column_def_options.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
......
...@@ -35,7 +35,7 @@ eval SET @@session.default_storage_engine = 'MyISAM'; ...@@ -35,7 +35,7 @@ eval SET @@session.default_storage_engine = 'MyISAM';
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines # Execute the tests to be applied to all storage engines
let $support_virtual_index= 0; let $support_virtual_index= 1;
--source suite/gcol/inc/gcol_ins_upd.inc --source suite/gcol/inc/gcol_ins_upd.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
......
...@@ -35,7 +35,8 @@ eval SET @@session.default_storage_engine = 'MyISAM'; ...@@ -35,7 +35,8 @@ eval SET @@session.default_storage_engine = 'MyISAM';
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines # Execute the tests to be applied to all storage engines
let $support_virtual_index= 0; let $support_virtual_index= 1;
let $skip_foreign_key_check=1;
--source suite/gcol/inc/gcol_keys.inc --source suite/gcol/inc/gcol_keys.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
......
...@@ -40,7 +40,7 @@ eval SET optimizer_switch='derived_merge=off'; ...@@ -40,7 +40,7 @@ eval SET optimizer_switch='derived_merge=off';
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines # Execute the tests to be applied to all storage engines
let $support_virtual_index= 0; let $support_virtual_index= 1;
--source suite/gcol/inc/gcol_select.inc --source suite/gcol/inc/gcol_select.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
......
...@@ -23,22 +23,21 @@ ...@@ -23,22 +23,21 @@
--echo # - CHECK (allowed but not used) --echo # - CHECK (allowed but not used)
--echo # UNIQUE --echo # UNIQUE
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
create table t1 (a int, b int as (a*2) unique); create table t1 (a int, b int as (a*2) unique);
drop table t1;
create table t1 (a int, b int as (a*2) persistent unique); create table t1 (a int, b int as (a*2) persistent unique);
show create table t1; show create table t1;
describe t1; describe t1;
drop table t1; drop table t1;
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
create table t1 (a int, b int as (a*2), unique key (b)); create table t1 (a int, b int as (a*2), unique key (b));
drop table t1;
create table t1 (a int, b int as (a*2) persistent, unique (b)); create table t1 (a int, b int as (a*2) persistent, unique (b));
show create table t1; show create table t1;
describe t1; describe t1;
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2)); create table t1 (a int, b int as (a*2));
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
alter table t1 add unique key (b); alter table t1 add unique key (b);
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2) persistent); create table t1 (a int, b int as (a*2) persistent);
...@@ -52,10 +51,10 @@ drop table t1; ...@@ -52,10 +51,10 @@ drop table t1;
--echo # --echo #
--echo # INDEX --echo # INDEX
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
create table t1 (a int, b int as (a*2), index (b)); create table t1 (a int, b int as (a*2), index (b));
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN drop table t1;
create table t1 (a int, b int as (a*2), index (a,b)); create table t1 (a int, b int as (a*2), index (a,b));
drop table t1;
create table t1 (a int, b int as (a*2) persistent, index (b)); create table t1 (a int, b int as (a*2) persistent, index (b));
show create table t1; show create table t1;
...@@ -68,9 +67,7 @@ describe t1; ...@@ -68,9 +67,7 @@ describe t1;
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2)); create table t1 (a int, b int as (a*2));
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
alter table t1 add index (b); alter table t1 add index (b);
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
alter table t1 add index (a,b); alter table t1 add index (a,b);
drop table t1; drop table t1;
...@@ -125,14 +122,16 @@ alter table t1 add foreign key (b) references t2(a) on update cascade; ...@@ -125,14 +122,16 @@ alter table t1 add foreign key (b) references t2(a) on update cascade;
alter table t1 add foreign key (b) references t2(a) on delete set null; alter table t1 add foreign key (b) references t2(a) on delete set null;
drop table t1; drop table t1;
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN if ($with_foreign_keys) {
create table t1 (a int, b int as (a+1), --error ER_CANT_CREATE_TABLE
foreign key (b) references t2(a)); create table t1 (a int, b int as (a+1), foreign key (b) references t2(a));
create table t1 (a int, b int as (a+1)); create table t1 (a int, b int as (a+1));
--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN --replace_regex /`#sql-.*`/`#sql-temporary`/
--error ER_CANT_CREATE_TABLE
alter table t1 add foreign key (b) references t2(a); alter table t1 add foreign key (b) references t2(a);
drop table t1; drop table t1;
}
--echo # Allowed FK options. --echo # Allowed FK options.
create table t2 (a int primary key, b char(5)); create table t2 (a int primary key, b char(5));
......
create table t1 (a int, b int as (a+1), c int, index(b));
insert t1 (a,c) values (0x7890abcd, 0x76543210);
insert t1 (a,c) select seq, sin(seq)*10000 from seq_1_to_1000;
explain select * from t1 where b=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 1
select * from t1 where b=10;
a b c
9 10 4121
MyISAM file: datadir/test/t1
Record format: Fixed length
Character set: latin1_swedish_ci (8)
Data records: 1001 Deleted blocks: 0
Recordlength: 9
table description:
Key Start Len Index Type
1 10 4 multip. long NULL
update t1 set a=20 where b=10;
select * from t1 where b=10;
a b c
select * from t1 where b=21;
a b c
20 21 4121
20 21 9129
delete from t1 where b=21;
select * from t1 where b=21;
a b c
alter table t1 add column d char(20) as (concat(a,c));
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
create index i on t1 (d);
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
check table t1 quick;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
check table t1 medium;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
check table t1 extended;
Table Op Msg_type Msg_text
test.t1 check status OK
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 b 1 b A 999 NULL NULL YES BTREE
t1 1 i 1 d A 999 NULL NULL YES BTREE
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
delete from t1 where b=12;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 b 1 b A 998 NULL NULL YES BTREE
t1 1 i 1 d A 998 NULL NULL YES BTREE
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 b 1 b A 998 NULL NULL YES BTREE
t1 1 i 1 d A 998 NULL NULL YES BTREE
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
repair table t1 quick;
Table Op Msg_type Msg_text
test.t1 repair status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
repair table t1 extended;
Table Op Msg_type Msg_text
test.t1 repair status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 998
test.t1 repair status OK
select * from t1 where b=11;
a b c d
10 11 -5440 10-5440
update t1 set a=30 where b=11;
select * from t1 where b=11;
a b c d
select * from t1 where b=31;
a b c d
30 31 -5440 30-5440
30 31 -9880 30-9880
drop table t1;
SET @@session.storage_engine = 'MyISAM'; SET @@session.storage_engine = 'MyISAM';
# - UNIQUE KEY # - UNIQUE KEY
# - INDEX # - INDEX
...@@ -7,7 +123,7 @@ SET @@session.storage_engine = 'MyISAM'; ...@@ -7,7 +123,7 @@ SET @@session.storage_engine = 'MyISAM';
# - CHECK (allowed but not used) # - CHECK (allowed but not used)
# UNIQUE # UNIQUE
create table t1 (a int, b int as (a*2) unique); create table t1 (a int, b int as (a*2) unique);
ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1;
create table t1 (a int, b int as (a*2) persistent unique); create table t1 (a int, b int as (a*2) persistent unique);
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -22,7 +138,7 @@ a int(11) YES NULL ...@@ -22,7 +138,7 @@ a int(11) YES NULL
b int(11) YES UNI NULL PERSISTENT b int(11) YES UNI NULL PERSISTENT
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2), unique key (b)); create table t1 (a int, b int as (a*2), unique key (b));
ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1;
create table t1 (a int, b int as (a*2) persistent, unique (b)); create table t1 (a int, b int as (a*2) persistent, unique (b));
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -38,7 +154,6 @@ b int(11) YES UNI NULL PERSISTENT ...@@ -38,7 +154,6 @@ b int(11) YES UNI NULL PERSISTENT
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2)); create table t1 (a int, b int as (a*2));
alter table t1 add unique key (b); alter table t1 add unique key (b);
ERROR HY000: Key/Index cannot be defined on a non-stored computed column
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2) persistent); create table t1 (a int, b int as (a*2) persistent);
alter table t1 add unique key (b); alter table t1 add unique key (b);
...@@ -50,9 +165,9 @@ drop table t1; ...@@ -50,9 +165,9 @@ drop table t1;
# #
# INDEX # INDEX
create table t1 (a int, b int as (a*2), index (b)); create table t1 (a int, b int as (a*2), index (b));
ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1;
create table t1 (a int, b int as (a*2), index (a,b)); create table t1 (a int, b int as (a*2), index (a,b));
ERROR HY000: Key/Index cannot be defined on a non-stored computed column drop table t1;
create table t1 (a int, b int as (a*2) persistent, index (b)); create table t1 (a int, b int as (a*2) persistent, index (b));
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -81,9 +196,7 @@ b int(11) YES NULL PERSISTENT ...@@ -81,9 +196,7 @@ b int(11) YES NULL PERSISTENT
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2)); create table t1 (a int, b int as (a*2));
alter table t1 add index (b); alter table t1 add index (b);
ERROR HY000: Key/Index cannot be defined on a non-stored computed column
alter table t1 add index (a,b); alter table t1 add index (a,b);
ERROR HY000: Key/Index cannot be defined on a non-stored computed column
drop table t1; drop table t1;
create table t1 (a int, b int as (a*2) persistent); create table t1 (a int, b int as (a*2) persistent);
alter table t1 add index (b); alter table t1 add index (b);
...@@ -125,13 +238,6 @@ ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a comput ...@@ -125,13 +238,6 @@ ERROR HY000: Cannot define foreign key with ON UPDATE CASCADE clause on a comput
alter table t1 add foreign key (b) references t2(a) on delete set null; alter table t1 add foreign key (b) references t2(a) on delete set null;
ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column ERROR HY000: Cannot define foreign key with ON DELETE SET NULL clause on a computed column
drop table t1; drop table t1;
create table t1 (a int, b int as (a+1),
foreign key (b) references t2(a));
ERROR HY000: Key/Index cannot be defined on a non-stored computed column
create table t1 (a int, b int as (a+1));
alter table t1 add foreign key (b) references t2(a);
ERROR HY000: Key/Index cannot be defined on a non-stored computed column
drop table t1;
# Allowed FK options. # Allowed FK options.
create table t2 (a int primary key, b char(5)); create table t2 (a int primary key, b char(5));
create table t1 (a int, b int as (a % 10) persistent, create table t1 (a int, b int as (a % 10) persistent,
......
--source include/have_sequence.inc
--let $datadir= `select @@datadir`
create table t1 (a int, b int as (a+1), c int, index(b));
insert t1 (a,c) values (0x7890abcd, 0x76543210);
insert t1 (a,c) select seq, sin(seq)*10000 from seq_1_to_1000;
explain select * from t1 where b=10;
select * from t1 where b=10;
--replace_result $datadir datadir
--exec $MYISAMCHK -d $datadir/test/t1
update t1 set a=20 where b=10;
select * from t1 where b=10;
select * from t1 where b=21;
delete from t1 where b=21;
select * from t1 where b=21;
alter table t1 add column d char(20) as (concat(a,c));
select * from t1 where b=11;
create index i on t1 (d);
check table t1;
select * from t1 where b=11;
check table t1 quick;
select * from t1 where b=11;
check table t1 medium;
select * from t1 where b=11;
check table t1 extended;
show keys from t1;
select * from t1 where b=11;
delete from t1 where b=12;
analyze table t1;
show keys from t1;
select * from t1 where b=11;
optimize table t1;
show keys from t1;
select * from t1 where b=11;
repair table t1;
select * from t1 where b=11;
repair table t1 quick;
select * from t1 where b=11;
repair table t1 extended;
select * from t1 where b=11;
repair table t1 use_frm;
select * from t1 where b=11;
update t1 set a=30 where b=11;
select * from t1 where b=11;
select * from t1 where b=31;
--error 1
--exec $MYISAMCHK $datadir/test/t1
--error 1
--exec $MYISAMCHK -r $datadir/test/t1
drop table t1;
################################################################################ ################################################################################
# t/vcol_keys_myisam.test # # t/vcol_keys_myisam.test #
# # # #
......
...@@ -168,7 +168,7 @@ static inline uint get_first_set(my_bitmap_map value, uint word_pos) ...@@ -168,7 +168,7 @@ static inline uint get_first_set(my_bitmap_map value, uint word_pos)
my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
my_bool thread_safe __attribute__((unused))) my_bool thread_safe)
{ {
DBUG_ENTER("my_bitmap_init"); DBUG_ENTER("my_bitmap_init");
if (!buf) if (!buf)
......
...@@ -1175,6 +1175,11 @@ class Field: public Value_source ...@@ -1175,6 +1175,11 @@ class Field: public Value_source
ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg; ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
} }
inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; } inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; }
inline uchar *record_ptr() // record[0] or wherever the field was moved to
{
my_ptrdiff_t offset= table->s->field[field_index]->ptr - table->s->default_values;
return ptr - offset;
}
virtual void move_field_offset(my_ptrdiff_t ptr_diff) virtual void move_field_offset(my_ptrdiff_t ptr_diff)
{ {
ptr=ADD_TO_PTR(ptr,ptr_diff, uchar*); ptr=ADD_TO_PTR(ptr,ptr_diff, uchar*);
......
...@@ -3916,12 +3916,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -3916,12 +3916,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
} }
} }
#endif #endif
if (!sql_field->stored_in_db())
{
/* Key fields must always be physically stored. */
my_error(ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN, MYF(0));
DBUG_RETURN(TRUE);
}
if (key->type == Key::PRIMARY && sql_field->vcol_info) if (key->type == Key::PRIMARY && sql_field->vcol_info)
{ {
my_error(ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN, MYF(0)); my_error(ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN, MYF(0));
...@@ -6226,9 +6220,11 @@ static int compare_uint(const uint *s, const uint *t) ...@@ -6226,9 +6220,11 @@ static int compare_uint(const uint *s, const uint *t)
Check if the column is computed and either Check if the column is computed and either
is stored or is used in the partitioning expression. is stored or is used in the partitioning expression.
*/ */
static bool vcol_affecting_storage(const Virtual_column_info* vcol) static bool vcol_affecting_storage(const Virtual_column_info* vcol,
bool indexed)
{ {
return vcol && (vcol->is_stored() || vcol->is_in_partitioning_expr()); return vcol &&
(vcol->is_stored() || vcol->is_in_partitioning_expr() || indexed);
} }
/** /**
...@@ -6437,15 +6433,28 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -6437,15 +6433,28 @@ static bool fill_alter_inplace_info(THD *thd,
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE; ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE;
} }
if (vcol_affecting_storage(field->vcol_info) || if (vcol_affecting_storage(field->vcol_info,
vcol_affecting_storage(new_field->vcol_info)) field->flags & PART_KEY_FLAG) ||
vcol_affecting_storage(new_field->vcol_info, false))
{ {
if (is_equal == IS_EQUAL_NO || if (is_equal == IS_EQUAL_NO ||
!field->vcol_info || !new_field->vcol_info || !field->vcol_info || !new_field->vcol_info ||
!field->vcol_info->is_equal(new_field->vcol_info)) !field->vcol_info->is_equal(new_field->vcol_info))
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL; ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
else else
maybe_alter_vcol= true; {
if (!(ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_VCOL) &&
(ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_DEFAULT))
{ /*
a DEFAULT value of a some column was changed.
see if this vcol uses DEFAULT() function
*/
if (field->vcol_info->expr_item->walk(
&Item::check_func_default_processor, 0, 0))
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
}
}
maybe_alter_vcol= true;
} }
/* Check if field was renamed */ /* Check if field was renamed */
...@@ -6514,10 +6523,10 @@ static bool fill_alter_inplace_info(THD *thd, ...@@ -6514,10 +6523,10 @@ static bool fill_alter_inplace_info(THD *thd,
if (maybe_alter_vcol) if (maybe_alter_vcol)
{ {
/* /*
No virtual column was altered, but perhaps one of the other columns was, What if one of the normal columns was altered and it was part of the some
and that column was part of the vcol expression? virtual column expression? Currently we don't detect this correctly
We don't detect this correctly (FIXME), so let's just say that a vcol (FIXME), so let's just say that a vcol *might* be affected if any other
*might* be affected if any other column was altered. column was altered.
*/ */
if (ha_alter_info->handler_flags & if (ha_alter_info->handler_flags &
( Alter_inplace_info::ALTER_COLUMN_TYPE ( Alter_inplace_info::ALTER_COLUMN_TYPE
......
...@@ -254,7 +254,7 @@ int mysql_update(THD *thd, ...@@ -254,7 +254,7 @@ int mysql_update(THD *thd,
ha_rows *found_return, ha_rows *updated_return) ha_rows *found_return, ha_rows *updated_return)
{ {
bool using_limit= limit != HA_POS_ERROR; bool using_limit= limit != HA_POS_ERROR;
bool safe_update= MY_TEST(thd->variables.option_bits & OPTION_SAFE_UPDATES); bool safe_update= thd->variables.option_bits & OPTION_SAFE_UPDATES;
bool used_key_is_modified= FALSE, transactional_table, will_batch; bool used_key_is_modified= FALSE, transactional_table, will_batch;
bool can_compare_record; bool can_compare_record;
int res; int res;
...@@ -2383,6 +2383,9 @@ int multi_update::do_updates() ...@@ -2383,6 +2383,9 @@ int multi_update::do_updates()
field_num++; field_num++;
} while ((tbl= check_opt_it++)); } while ((tbl= check_opt_it++));
if (table->vfield && table->update_virtual_fields(VCOL_UPDATE_INDEXED))
goto err2;
table->status|= STATUS_UPDATED; table->status|= STATUS_UPDATED;
store_record(table,record[1]); store_record(table,record[1]);
......
...@@ -6211,7 +6211,11 @@ void TABLE::mark_columns_needed_for_delete() ...@@ -6211,7 +6211,11 @@ void TABLE::mark_columns_needed_for_delete()
for (reg_field= field ; *reg_field ; reg_field++) for (reg_field= field ; *reg_field ; reg_field++)
{ {
if ((*reg_field)->flags & PART_KEY_FLAG) if ((*reg_field)->flags & PART_KEY_FLAG)
{
bitmap_set_bit(read_set, (*reg_field)->field_index); bitmap_set_bit(read_set, (*reg_field)->field_index);
if ((*reg_field)->vcol_info)
mark_virtual_col(*reg_field);
}
} }
need_signal= true; need_signal= true;
} }
...@@ -6544,7 +6548,8 @@ bool TABLE::mark_virtual_columns_for_write(bool insert_fl) ...@@ -6544,7 +6548,8 @@ bool TABLE::mark_virtual_columns_for_write(bool insert_fl)
tmp_vfield= *vfield_ptr; tmp_vfield= *vfield_ptr;
if (bitmap_is_set(write_set, tmp_vfield->field_index)) if (bitmap_is_set(write_set, tmp_vfield->field_index))
bitmap_updated= mark_virtual_col(tmp_vfield); bitmap_updated= mark_virtual_col(tmp_vfield);
else if (tmp_vfield->vcol_info->stored_in_db) else if (tmp_vfield->vcol_info->stored_in_db ||
(tmp_vfield->flags & PART_KEY_FLAG))
{ {
if (insert_fl) if (insert_fl)
{ {
...@@ -7311,11 +7316,16 @@ int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode) ...@@ -7311,11 +7316,16 @@ int TABLE::update_virtual_fields(enum_vcol_update_mode update_mode)
} }
case VCOL_UPDATE_FOR_READ: case VCOL_UPDATE_FOR_READ:
update= !vcol_info->stored_in_db update= !vcol_info->stored_in_db
&& !(key_read && vf->part_of_key.is_set(file->active_index))
&& bitmap_is_set(vcol_set, vf->field_index); && bitmap_is_set(vcol_set, vf->field_index);
break; break;
case VCOL_UPDATE_FOR_WRITE: case VCOL_UPDATE_FOR_WRITE:
update= triggers || bitmap_is_set(vcol_set, vf->field_index); update= triggers || bitmap_is_set(vcol_set, vf->field_index);
break; break;
case VCOL_UPDATE_INDEXED:
update= !vcol_info->stored_in_db && (vf->flags & PART_KEY_FLAG)
&& bitmap_is_set(vcol_set, vf->field_index);
break;
} }
if (update) if (update)
......
...@@ -327,7 +327,8 @@ enum enum_vcol_update_mode ...@@ -327,7 +327,8 @@ enum enum_vcol_update_mode
{ {
VCOL_UPDATE_FOR_READ= 0, VCOL_UPDATE_FOR_READ= 0,
VCOL_UPDATE_FOR_READ_WRITE, VCOL_UPDATE_FOR_READ_WRITE,
VCOL_UPDATE_FOR_WRITE VCOL_UPDATE_FOR_WRITE,
VCOL_UPDATE_INDEXED
}; };
......
...@@ -574,7 +574,6 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, ...@@ -574,7 +574,6 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
extern "C" { extern "C" {
int killed_ptr(HA_CHECK *param) int killed_ptr(HA_CHECK *param)
...@@ -661,6 +660,25 @@ my_bool mi_killed_in_mariadb(MI_INFO *info) ...@@ -661,6 +660,25 @@ my_bool mi_killed_in_mariadb(MI_INFO *info)
return (((TABLE*) (info->external_ref))->in_use->killed != 0); return (((TABLE*) (info->external_ref))->in_use->killed != 0);
} }
static int compute_vcols(MI_INFO *info, uchar *record, int keynum)
{
TABLE *table= (TABLE*)(info->external_ref);
table->move_fields(table->field, record, table->field[0]->record_ptr());
if (keynum == -1) // update all vcols
return table->update_virtual_fields(VCOL_UPDATE_INDEXED);
// update only one key
KEY *key= table->key_info + keynum;
KEY_PART_INFO *kp= key->key_part, *end= kp + key->ext_key_parts;
for (; kp < end; kp++)
{
Field *f= table->field[kp->fieldnr - 1];
if (f->vcol_info)
table->update_virtual_field(f);
}
return 0;
}
} }
ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
...@@ -668,6 +686,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) ...@@ -668,6 +686,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_CAN_VIRTUAL_COLUMNS | HA_CAN_EXPORT | HA_CAN_VIRTUAL_COLUMNS | HA_CAN_EXPORT |
HA_REQUIRES_KEY_COLUMNS_FOR_DELETE |
HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS |
HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
...@@ -868,6 +887,27 @@ int ha_myisam::write_row(uchar *buf) ...@@ -868,6 +887,27 @@ int ha_myisam::write_row(uchar *buf)
return mi_write(file,buf); return mi_write(file,buf);
} }
void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
{
if (file->s->base.reclength < file->s->vreclength)
{
param->fix_record= compute_vcols;
table->use_all_columns();
table->vcol_set= &table->s->all_set;
}
else
DBUG_ASSERT(file->s->base.reclength == file->s->vreclength);
}
void ha_myisam::restore_vcos_after_repair()
{
if (file->s->base.reclength < file->s->vreclength)
{
table->move_fields(table->field, table->record[0], table->field[0]->record_ptr());
table->default_column_bitmaps();
}
}
int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
{ {
if (!file) return HA_ADMIN_INTERNAL_ERROR; if (!file) return HA_ADMIN_INTERNAL_ERROR;
...@@ -901,6 +941,8 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) ...@@ -901,6 +941,8 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
(uint) (share->global_changed ? 1 : 0))))) (uint) (share->global_changed ? 1 : 0)))))
return HA_ADMIN_ALREADY_DONE; return HA_ADMIN_ALREADY_DONE;
setup_vcols_for_repair(&param);
error = chk_status(&param, file); // Not fatal error = chk_status(&param, file); // Not fatal
error = chk_size(&param, file); error = chk_size(&param, file);
if (!error) if (!error)
...@@ -953,6 +995,8 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) ...@@ -953,6 +995,8 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
} }
restore_vcos_after_repair();
thd_proc_info(thd, old_proc_info); thd_proc_info(thd, old_proc_info);
return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK; return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
} }
...@@ -986,6 +1030,8 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) ...@@ -986,6 +1030,8 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
if (!(share->state.changed & STATE_NOT_ANALYZED)) if (!(share->state.changed & STATE_NOT_ANALYZED))
return HA_ADMIN_ALREADY_DONE; return HA_ADMIN_ALREADY_DONE;
setup_vcols_for_repair(&param);
error = chk_key(&param, file); error = chk_key(&param, file);
if (!error) if (!error)
{ {
...@@ -995,6 +1041,9 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) ...@@ -995,6 +1041,9 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
} }
else if (!mi_is_crashed(file) && !thd->killed) else if (!mi_is_crashed(file) && !thd->killed)
mi_mark_crashed(file); mi_mark_crashed(file);
restore_vcos_after_repair();
return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK; return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
} }
...@@ -1017,6 +1066,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) ...@@ -1017,6 +1066,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
param.sort_buffer_length= THDVAR(thd, sort_buffer_size); param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
param.backup_time= check_opt->start_time; param.backup_time= check_opt->start_time;
start_records=file->state->records; start_records=file->state->records;
setup_vcols_for_repair(&param);
while ((error=repair(thd,param,0)) && param.retry_repair) while ((error=repair(thd,param,0)) && param.retry_repair)
{ {
param.retry_repair=0; param.retry_repair=0;
...@@ -1040,6 +1092,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt) ...@@ -1040,6 +1092,9 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
} }
break; break;
} }
restore_vcos_after_repair();
if (!error && start_records != file->state->records && if (!error && start_records != file->state->records &&
!(check_opt->flags & T_VERY_SILENT)) !(check_opt->flags & T_VERY_SILENT))
{ {
...@@ -1066,6 +1121,9 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) ...@@ -1066,6 +1121,9 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX); T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX);
param.tmpfile_createflag= O_RDWR | O_TRUNC; param.tmpfile_createflag= O_RDWR | O_TRUNC;
param.sort_buffer_length= THDVAR(thd, sort_buffer_size); param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
setup_vcols_for_repair(&param);
if ((error= repair(thd,param,1)) && param.retry_repair) if ((error= repair(thd,param,1)) && param.retry_repair)
{ {
sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying", sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
...@@ -1073,6 +1131,9 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt) ...@@ -1073,6 +1131,9 @@ int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
param.testflag&= ~T_REP_BY_SORT; param.testflag&= ~T_REP_BY_SORT;
error= repair(thd,param,1); error= repair(thd,param,1);
} }
restore_vcos_after_repair();
return error; return error;
} }
...@@ -1482,6 +1543,9 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1482,6 +1543,9 @@ int ha_myisam::enable_indexes(uint mode)
param.sort_buffer_length= THDVAR(thd, sort_buffer_size); param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
param.stats_method= (enum_handler_stats_method)THDVAR(thd, stats_method); param.stats_method= (enum_handler_stats_method)THDVAR(thd, stats_method);
param.tmpdir=&mysql_tmpdir_list; param.tmpdir=&mysql_tmpdir_list;
setup_vcols_for_repair(&param);
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair) if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
{ {
sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying", sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
...@@ -1507,6 +1571,8 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1507,6 +1571,8 @@ int ha_myisam::enable_indexes(uint mode)
} }
info(HA_STATUS_CONST); info(HA_STATUS_CONST);
thd_proc_info(thd, save_proc_info); thd_proc_info(thd, save_proc_info);
restore_vcos_after_repair();
} }
else else
{ {
...@@ -2012,14 +2078,14 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, ...@@ -2012,14 +2078,14 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
TABLE_SHARE *share= table_arg->s; TABLE_SHARE *share= table_arg->s;
uint options= share->db_options_in_use; uint options= share->db_options_in_use;
DBUG_ENTER("ha_myisam::create"); DBUG_ENTER("ha_myisam::create");
for (i= 0; i < share->keys; i++)
{ for (i= 0; i < share->virtual_fields && !create_flags; i++)
if (table_arg->vfield[i]->flags & PART_KEY_FLAG)
create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER;
for (i= 0; i < share->keys && !create_flags; i++)
if (table_arg->key_info[i].flags & HA_USES_PARSER) if (table_arg->key_info[i].flags & HA_USES_PARSER)
{
create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER; create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER;
break;
}
}
if ((error= table2myisam(table_arg, &keydef, &recinfo, &record_count))) if ((error= table2myisam(table_arg, &keydef, &recinfo, &record_count)))
DBUG_RETURN(error); /* purecov: inspected */ DBUG_RETURN(error); /* purecov: inspected */
bzero((char*) &create_info, sizeof(create_info)); bzero((char*) &create_info, sizeof(create_info));
......
...@@ -48,6 +48,8 @@ class ha_myisam: public handler ...@@ -48,6 +48,8 @@ class ha_myisam: public handler
char *data_file_name, *index_file_name; char *data_file_name, *index_file_name;
bool can_enable_indexes; bool can_enable_indexes;
int repair(THD *thd, HA_CHECK &param, bool optimize); int repair(THD *thd, HA_CHECK &param, bool optimize);
void setup_vcols_for_repair(HA_CHECK *param);
void restore_vcos_after_repair();
public: public:
ha_myisam(handlerton *hton, TABLE_SHARE *table_arg); ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
......
...@@ -1190,6 +1190,8 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) ...@@ -1190,6 +1190,8 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
DBUG_ASSERT(0); /* Impossible */ DBUG_ASSERT(0); /* Impossible */
break; break;
} /* switch */ } /* switch */
if (param->fix_record)
param->fix_record(info, record, -1);
if (! got_error) if (! got_error)
{ {
intern_record_checksum+=(ha_checksum) start_recpos; intern_record_checksum+=(ha_checksum) start_recpos;
...@@ -3646,6 +3648,10 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) ...@@ -3646,6 +3648,10 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
finish: finish:
if (sort_param->calc_checksum) if (sort_param->calc_checksum)
param->glob_crc+= info->checksum; param->glob_crc+= info->checksum;
if (param->fix_record)
param->fix_record(info, sort_param->record,
param->testflag & T_REP_BY_SORT ? (int)sort_param->key
: -1);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -328,6 +328,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -328,6 +328,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
strmov(share->index_file_name, index_name); strmov(share->index_file_name, index_name);
strmov(share->data_file_name, data_name); strmov(share->data_file_name, data_name);
share->vreclength= share->base.reclength;
share->blocksize=MY_MIN(IO_SIZE,myisam_block_size); share->blocksize=MY_MIN(IO_SIZE,myisam_block_size);
{ {
HA_KEYSEG *pos=share->keyparts; HA_KEYSEG *pos=share->keyparts;
...@@ -335,6 +336,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -335,6 +336,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for (i=0 ; i < keys ; i++) for (i=0 ; i < keys ; i++)
{ {
MI_KEYDEF *keyinfo= share->keyinfo + i; MI_KEYDEF *keyinfo= share->keyinfo + i;
uint sp_segs;
keyinfo->share= share; keyinfo->share= share;
disk_pos=mi_keydef_read(disk_pos, keyinfo); disk_pos=mi_keydef_read(disk_pos, keyinfo);
disk_pos_assert(disk_pos + keyinfo->keysegs * HA_KEYSEG_SIZE, end_pos); disk_pos_assert(disk_pos + keyinfo->keysegs * HA_KEYSEG_SIZE, end_pos);
...@@ -342,7 +344,11 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -342,7 +344,11 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
have_rtree=1; have_rtree=1;
set_if_smaller(share->blocksize, keyinfo->block_length); set_if_smaller(share->blocksize, keyinfo->block_length);
keyinfo->seg= pos; keyinfo->seg= pos;
for (j=0 ; j < keyinfo->keysegs; j++,pos++) if (keyinfo->flag & HA_SPATIAL)
sp_segs= 2*SPDIMS;
else
sp_segs= 0;
for (j=0 ; j < keyinfo->keysegs; j++, pos++)
{ {
disk_pos=mi_keyseg_read(disk_pos, pos); disk_pos=mi_keyseg_read(disk_pos, pos);
if (pos->flag & HA_BLOB_PART && if (pos->flag & HA_BLOB_PART &&
...@@ -366,17 +372,16 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -366,17 +372,16 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
} }
else if (pos->type == HA_KEYTYPE_BINARY) else if (pos->type == HA_KEYTYPE_BINARY)
pos->charset= &my_charset_bin; pos->charset= &my_charset_bin;
if (!(keyinfo->flag & HA_SPATIAL) && if (j < keyinfo->keysegs - sp_segs)
pos->start > share->base.reclength)
{ {
my_errno= HA_ERR_CRASHED; uint real_length= pos->flag & HA_BLOB_PART ? pos->bit_start
goto err; : pos->length;
set_if_bigger(share->vreclength, pos->start + real_length);
} }
} }
if (keyinfo->flag & HA_SPATIAL) if (keyinfo->flag & HA_SPATIAL)
{ {
#ifdef HAVE_SPATIAL #ifdef HAVE_SPATIAL
uint sp_segs= SPDIMS*2;
keyinfo->seg= pos - sp_segs; keyinfo->seg= pos - sp_segs;
DBUG_ASSERT(keyinfo->keysegs == sp_segs + 1); DBUG_ASSERT(keyinfo->keysegs == sp_segs + 1);
keyinfo->keysegs= sp_segs; keyinfo->keysegs= sp_segs;
......
...@@ -199,6 +199,7 @@ typedef struct st_mi_isam_share ...@@ -199,6 +199,7 @@ typedef struct st_mi_isam_share
ulong max_pack_length; ulong max_pack_length;
ulong state_diff_length; ulong state_diff_length;
uint rec_reflength; /* rec_reflength in use now */ uint rec_reflength; /* rec_reflength in use now */
ulong vreclength; /* full reclength, including vcols */
uint unique_name_length; uint unique_name_length;
uint32 ftkeys; /* Number of full-text keys + 1 */ uint32 ftkeys; /* Number of full-text keys + 1 */
File kfile; /* Shared keyfile */ File kfile; /* Shared keyfile */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment