Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
850b2ba1
Commit
850b2ba1
authored
Aug 02, 2021
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.4' into 10.5
parents
ec8882b9
4902b0fd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
120 additions
and
116 deletions
+120
-116
mysql-test/main/processlist_notembedded.result
mysql-test/main/processlist_notembedded.result
+1
-0
mysql-test/main/processlist_notembedded.test
mysql-test/main/processlist_notembedded.test
+4
-3
mysql-test/suite/gcol/inc/gcol_partition.inc
mysql-test/suite/gcol/inc/gcol_partition.inc
+12
-0
mysql-test/suite/gcol/r/gcol_partition_innodb.result
mysql-test/suite/gcol/r/gcol_partition_innodb.result
+11
-0
mysql-test/suite/gcol/r/gcol_partition_myisam.result
mysql-test/suite/gcol/r/gcol_partition_myisam.result
+11
-0
mysql-test/suite/gcol/r/innodb_virtual_index.result
mysql-test/suite/gcol/r/innodb_virtual_index.result
+14
-0
mysql-test/suite/gcol/t/innodb_virtual_index.test
mysql-test/suite/gcol/t/innodb_virtual_index.test
+20
-0
sql/table.cc
sql/table.cc
+15
-0
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+0
-55
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+31
-47
storage/innobase/include/fts0fts.h
storage/innobase/include/fts0fts.h
+1
-11
No files found.
mysql-test/main/processlist_notembedded.result
View file @
850b2ba1
...
@@ -28,6 +28,7 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -28,6 +28,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Warnings:
Note 1003 select sleep(100000)
Note 1003 select sleep(100000)
KILL QUERY $con_id;
KILL QUERY $con_id;
disconnect con1;
#
#
# End of 10.2 tests
# End of 10.2 tests
#
#
mysql-test/main/processlist_notembedded.test
View file @
850b2ba1
source
include
/
have_debug
.
inc
;
source
include
/
have_debug_sync
.
inc
;
source
include
/
have_debug_sync
.
inc
;
source
include
/
not_embedded
.
inc
;
source
include
/
not_embedded
.
inc
;
source
include
/
count_sessions
.
inc
;
source
include
/
count_sessions
.
inc
;
...
@@ -37,8 +36,6 @@ connection default;
...
@@ -37,8 +36,6 @@ connection default;
SET
DEBUG_SYNC
=
'RESET'
;
SET
DEBUG_SYNC
=
'RESET'
;
source
include
/
wait_until_count_sessions
.
inc
;
--
echo
#
--
echo
#
--
echo
# End of 5.5 tests
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
...
@@ -52,8 +49,12 @@ source include/wait_until_count_sessions.inc;
...
@@ -52,8 +49,12 @@ source include/wait_until_count_sessions.inc;
--
send
select
sleep
(
100000
)
--
send
select
sleep
(
100000
)
--
connection
default
--
connection
default
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
information_schema
.
processlist
where
state
=
'User sleep'
;
source
include
/
wait_condition
.
inc
;
evalp
SHOW
EXPLAIN
FOR
$con_id
;
evalp
SHOW
EXPLAIN
FOR
$con_id
;
evalp
KILL
QUERY
$con_id
;
evalp
KILL
QUERY
$con_id
;
disconnect
con1
;
source
include
/
wait_until_count_sessions
.
inc
;
--
echo
#
--
echo
#
--
echo
# End of 10.2 tests
--
echo
# End of 10.2 tests
...
...
mysql-test/suite/gcol/inc/gcol_partition.inc
View file @
850b2ba1
...
@@ -169,3 +169,15 @@ CREATE TABLE t1 (
...
@@ -169,3 +169,15 @@ CREATE TABLE t1 (
INSERT
INTO
t1
()
VALUES
(),();
INSERT
INTO
t1
()
VALUES
(),();
UPDATE
t1
SET
a
=
0
WHERE
b
IS
NULL
ORDER
BY
pk
;
UPDATE
t1
SET
a
=
0
WHERE
b
IS
NULL
ORDER
BY
pk
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-26220 Server crashes with indexed by prefix virtual column
--
echo
#
CREATE
TABLE
t1
(
pk
INT
PRIMARY
KEY
,
a
INT
,
b
CHAR
(
20
),
c
CHAR
(
20
)
AS
(
b
),
KEY
(
c
(
10
),
a
))
PARTITION
BY
HASH
(
pk
);
INSERT
INTO
t1
(
pk
,
a
,
b
)
VALUES
(
1
,
10
,
'foo'
),(
2
,
11
,
'baz'
);
SELECT
a
FROM
t1
;
# Cleanup
DROP
TABLE
t1
;
mysql-test/suite/gcol/r/gcol_partition_innodb.result
View file @
850b2ba1
...
@@ -104,6 +104,17 @@ INSERT INTO t1 () VALUES (),();
...
@@ -104,6 +104,17 @@ INSERT INTO t1 () VALUES (),();
UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-26220 Server crashes with indexed by prefix virtual column
#
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(20), c CHAR(20) AS (b),
KEY (c(10),a)) PARTITION BY HASH(pk);
INSERT INTO t1 (pk,a,b) VALUES (1,10,'foo'),(2,11,'baz');
SELECT a FROM t1;
a
11
10
DROP TABLE t1;
#
# MDEV-16980 Wrongly set tablename len while opening the
# MDEV-16980 Wrongly set tablename len while opening the
# table for purge thread
# table for purge thread
#
#
...
...
mysql-test/suite/gcol/r/gcol_partition_myisam.result
View file @
850b2ba1
...
@@ -101,6 +101,17 @@ KEY (b,d)
...
@@ -101,6 +101,17 @@ KEY (b,d)
INSERT INTO t1 () VALUES (),();
INSERT INTO t1 () VALUES (),();
UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
UPDATE t1 SET a = 0 WHERE b IS NULL ORDER BY pk;
DROP TABLE t1;
DROP TABLE t1;
#
# MDEV-26220 Server crashes with indexed by prefix virtual column
#
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, b CHAR(20), c CHAR(20) AS (b),
KEY (c(10),a)) PARTITION BY HASH(pk);
INSERT INTO t1 (pk,a,b) VALUES (1,10,'foo'),(2,11,'baz');
SELECT a FROM t1;
a
11
10
DROP 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;
...
...
mysql-test/suite/gcol/r/innodb_virtual_index.result
View file @
850b2ba1
...
@@ -296,3 +296,17 @@ Table Op Msg_type Msg_text
...
@@ -296,3 +296,17 @@ Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
test.t1 optimize status OK
DROP TABLE t1;
DROP TABLE t1;
#
# MDEV-20154 Assertion `len <= col->len || ((col->mtype) == 5
# || (col->mtype) == 14)' failed in row_merge_buf_add
#
CREATE TABLE t1 (
a VARCHAR(2500),
b VARCHAR(2499) AS (a) VIRTUAL
) ENGINE=InnoDB;
INSERT INTO t1 (a) VALUES ('foo');
ALTER TABLE t1 MODIFY a VARCHAR(2600), ALGORITHM=INPLACE;
ALTER TABLE t1 ADD KEY (b), ALGORITHM=INPLACE;
# Cleanup
DROP TABLE t1;
# End of 10.2 tests
mysql-test/suite/gcol/t/innodb_virtual_index.test
View file @
850b2ba1
...
@@ -314,3 +314,23 @@ CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(3),
...
@@ -314,3 +314,23 @@ CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(3),
INSERT
INTO
t1
(
id
,
a
)
VALUES
(
1
,
'foo'
);
INSERT
INTO
t1
(
id
,
a
)
VALUES
(
1
,
'foo'
);
OPTIMIZE
TABLE
t1
;
OPTIMIZE
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-20154 Assertion `len <= col->len || ((col->mtype) == 5
--
echo
# || (col->mtype) == 14)' failed in row_merge_buf_add
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
2500
),
b
VARCHAR
(
2499
)
AS
(
a
)
VIRTUAL
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
(
a
)
VALUES
(
'foo'
);
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
2600
),
ALGORITHM
=
INPLACE
;
ALTER
TABLE
t1
ADD
KEY
(
b
),
ALGORITHM
=
INPLACE
;
--
echo
# Cleanup
DROP
TABLE
t1
;
--
echo
# End of 10.2 tests
sql/table.cc
View file @
850b2ba1
...
@@ -4092,6 +4092,21 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
...
@@ -4092,6 +4092,21 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
/* Update to use trigger fields */
/* Update to use trigger fields */
switch_defaults_to_nullable_trigger_fields
(
outparam
);
switch_defaults_to_nullable_trigger_fields
(
outparam
);
for
(
uint
k
=
0
;
k
<
share
->
keys
;
k
++
)
{
KEY
&
key_info
=
outparam
->
key_info
[
k
];
uint
parts
=
(
share
->
use_ext_keys
?
key_info
.
ext_key_parts
:
key_info
.
user_defined_key_parts
);
for
(
uint
p
=
0
;
p
<
parts
;
p
++
)
{
KEY_PART_INFO
&
kp
=
key_info
.
key_part
[
p
];
if
(
kp
.
field
!=
outparam
->
field
[
kp
.
fieldnr
-
1
])
{
kp
.
field
->
vcol_info
=
outparam
->
field
[
kp
.
fieldnr
-
1
]
->
vcol_info
;
}
}
}
}
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
#ifdef WITH_PARTITION_STORAGE_ENGINE
...
...
storage/innobase/fts/fts0fts.cc
View file @
850b2ba1
...
@@ -6314,58 +6314,3 @@ fts_init_index(
...
@@ -6314,58 +6314,3 @@ fts_init_index(
return
(
TRUE
);
return
(
TRUE
);
}
}
/** Check if the all the auxillary tables associated with FTS index are in
consistent state. For now consistency is check only by ensuring
index->page_no != FIL_NULL
@param[out] base_table table has host fts index
@param[in,out] trx trx handler */
void
fts_check_corrupt
(
dict_table_t
*
base_table
,
trx_t
*
trx
)
{
bool
sane
=
true
;
fts_table_t
fts_table
;
/* Iterate over the common table and check for their sanity. */
FTS_INIT_FTS_TABLE
(
&
fts_table
,
NULL
,
FTS_COMMON_TABLE
,
base_table
);
for
(
ulint
i
=
0
;
fts_common_tables
[
i
]
!=
NULL
&&
sane
;
++
i
)
{
char
table_name
[
MAX_FULL_NAME_LEN
];
fts_table
.
suffix
=
fts_common_tables
[
i
];
fts_get_table_name
(
&
fts_table
,
table_name
);
dict_table_t
*
aux_table
=
dict_table_open_on_name
(
table_name
,
true
,
FALSE
,
DICT_ERR_IGNORE_NONE
);
if
(
aux_table
==
NULL
)
{
dict_set_corrupted
(
dict_table_get_first_index
(
base_table
),
trx
,
"FTS_SANITY_CHECK"
);
ut_ad
(
base_table
->
corrupted
==
TRUE
);
sane
=
false
;
continue
;
}
for
(
dict_index_t
*
aux_table_index
=
UT_LIST_GET_FIRST
(
aux_table
->
indexes
);
aux_table_index
!=
NULL
;
aux_table_index
=
UT_LIST_GET_NEXT
(
indexes
,
aux_table_index
))
{
/* Check if auxillary table needed for FTS is sane. */
if
(
aux_table_index
->
page
==
FIL_NULL
)
{
dict_set_corrupted
(
dict_table_get_first_index
(
base_table
),
trx
,
"FTS_SANITY_CHECK"
);
ut_ad
(
base_table
->
corrupted
==
TRUE
);
sane
=
false
;
}
}
dict_table_close
(
aux_table
,
FALSE
,
FALSE
);
}
}
storage/innobase/handler/handler0alter.cc
View file @
850b2ba1
...
@@ -7505,6 +7505,10 @@ alter_fill_stored_column(
...
@@ -7505,6 +7505,10 @@ alter_fill_stored_column(
}
}
}
}
static
bool
alter_templ_needs_rebuild
(
const
TABLE
*
altered_table
,
const
Alter_inplace_info
*
ha_alter_info
,
const
dict_table_t
*
table
);
/** Allows InnoDB to update internal structures with concurrent
/** Allows InnoDB to update internal structures with concurrent
writes blocked (provided that check_if_supported_inplace_alter()
writes blocked (provided that check_if_supported_inplace_alter()
...
@@ -7652,11 +7656,7 @@ ha_innobase::prepare_inplace_alter_table(
...
@@ -7652,11 +7656,7 @@ ha_innobase::prepare_inplace_alter_table(
ha_alter_info
->
key_count
))
{
ha_alter_info
->
key_count
))
{
err_exit_no_heap:
err_exit_no_heap:
DBUG_ASSERT
(
m_prebuilt
->
trx
->
dict_operation_lock_mode
==
0
);
DBUG_ASSERT
(
m_prebuilt
->
trx
->
dict_operation_lock_mode
==
0
);
if
(
ha_alter_info
->
handler_flags
&
~
INNOBASE_INPLACE_IGNORE
)
{
online_retry_drop_indexes
(
m_prebuilt
->
table
,
m_user_thd
);
online_retry_drop_indexes
(
m_prebuilt
->
table
,
m_user_thd
);
}
DBUG_RETURN
(
true
);
DBUG_RETURN
(
true
);
}
}
...
@@ -8112,9 +8112,9 @@ ha_innobase::prepare_inplace_alter_table(
...
@@ -8112,9 +8112,9 @@ ha_innobase::prepare_inplace_alter_table(
==
ALTER_OPTIONS
==
ALTER_OPTIONS
&&
!
alter_options_need_rebuild
(
ha_alter_info
,
table
)))
{
&&
!
alter_options_need_rebuild
(
ha_alter_info
,
table
)))
{
ha_innobase_inplace_ctx
*
ctx
=
NULL
;
if
(
heap
)
{
if
(
heap
)
{
ha_alter_info
->
handler_ctx
ctx
=
new
ha_innobase_inplace_ctx
(
=
new
ha_innobase_inplace_ctx
(
m_prebuilt
,
m_prebuilt
,
drop_index
,
n_drop_index
,
drop_index
,
n_drop_index
,
drop_fk
,
n_drop_fk
,
drop_fk
,
n_drop_fk
,
...
@@ -8126,15 +8126,11 @@ ha_innobase::prepare_inplace_alter_table(
...
@@ -8126,15 +8126,11 @@ ha_innobase::prepare_inplace_alter_table(
||
!
thd_is_strict_mode
(
m_user_thd
)),
||
!
thd_is_strict_mode
(
m_user_thd
)),
alt_opt
.
page_compressed
,
alt_opt
.
page_compressed
,
alt_opt
.
page_compression_level
);
alt_opt
.
page_compression_level
);
ha_alter_info
->
handler_ctx
=
ctx
;
}
}
DBUG_ASSERT
(
m_prebuilt
->
trx
->
dict_operation_lock_mode
==
0
);
DBUG_ASSERT
(
m_prebuilt
->
trx
->
dict_operation_lock_mode
==
0
);
if
(
ha_alter_info
->
handler_flags
&
~
(
INNOBASE_INPLACE_IGNORE
))
{
online_retry_drop_indexes
(
m_prebuilt
->
table
,
m_user_thd
);
online_retry_drop_indexes
(
m_prebuilt
->
table
,
m_user_thd
);
}
if
((
ha_alter_info
->
handler_flags
if
((
ha_alter_info
->
handler_flags
&
ALTER_DROP_VIRTUAL_COLUMN
)
&
ALTER_DROP_VIRTUAL_COLUMN
)
...
@@ -8149,6 +8145,24 @@ ha_innobase::prepare_inplace_alter_table(
...
@@ -8149,6 +8145,24 @@ ha_innobase::prepare_inplace_alter_table(
DBUG_RETURN
(
true
);
DBUG_RETURN
(
true
);
}
}
if
(
!
(
ha_alter_info
->
handler_flags
&
INNOBASE_ALTER_DATA
)
&&
alter_templ_needs_rebuild
(
altered_table
,
ha_alter_info
,
ctx
->
new_table
)
&&
ctx
->
new_table
->
n_v_cols
>
0
)
{
/* Changing maria record structure may end up here only
if virtual columns were altered. In this case, however,
vc_templ should be rebuilt. Since we don't actually
change any stored data, we can just dispose vc_templ;
it will be recreated on next ha_innobase::open(). */
DBUG_ASSERT
(
ctx
->
new_table
==
ctx
->
old_table
);
dict_free_vc_templ
(
ctx
->
new_table
->
vc_templ
);
UT_DELETE
(
ctx
->
new_table
->
vc_templ
);
ctx
->
new_table
->
vc_templ
=
NULL
;
}
DBUG_RETURN
(
false
);
DBUG_RETURN
(
false
);
}
}
...
@@ -8260,35 +8274,6 @@ ha_innobase::prepare_inplace_alter_table(
...
@@ -8260,35 +8274,6 @@ ha_innobase::prepare_inplace_alter_table(
add_fts_doc_id_idx
));
add_fts_doc_id_idx
));
}
}
/** Check that the column is part of a virtual index(index contains
virtual column) in the table
@param[in] table Table containing column
@param[in] col column to be checked
@return true if this column is indexed with other virtual columns */
static
bool
dict_col_in_v_indexes
(
dict_table_t
*
table
,
dict_col_t
*
col
)
{
for
(
dict_index_t
*
index
=
dict_table_get_next_index
(
dict_table_get_first_index
(
table
));
index
!=
NULL
;
index
=
dict_table_get_next_index
(
index
))
{
if
(
!
dict_index_has_virtual
(
index
))
{
continue
;
}
for
(
ulint
k
=
0
;
k
<
index
->
n_fields
;
k
++
)
{
dict_field_t
*
field
=
dict_index_get_nth_field
(
index
,
k
);
if
(
field
->
col
->
ind
==
col
->
ind
)
{
return
(
true
);
}
}
}
return
(
false
);
}
/* Check whether a columnn length change alter operation requires
/* Check whether a columnn length change alter operation requires
to rebuild the template.
to rebuild the template.
@param[in] altered_table TABLE object for new version of table.
@param[in] altered_table TABLE object for new version of table.
...
@@ -8300,9 +8285,9 @@ to rebuild the template.
...
@@ -8300,9 +8285,9 @@ to rebuild the template.
static
static
bool
bool
alter_templ_needs_rebuild
(
alter_templ_needs_rebuild
(
TABLE
*
altered_table
,
const
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
,
const
Alter_inplace_info
*
ha_alter_info
,
dict_table_t
*
table
)
const
dict_table_t
*
table
)
{
{
ulint
i
=
0
;
ulint
i
=
0
;
...
@@ -8312,8 +8297,7 @@ alter_templ_needs_rebuild(
...
@@ -8312,8 +8297,7 @@ alter_templ_needs_rebuild(
for
(
ulint
j
=
0
;
j
<
table
->
n_cols
;
j
++
)
{
for
(
ulint
j
=
0
;
j
<
table
->
n_cols
;
j
++
)
{
dict_col_t
*
cols
dict_col_t
*
cols
=
dict_table_get_nth_col
(
table
,
j
);
=
dict_table_get_nth_col
(
table
,
j
);
if
(
cf
.
length
>
cols
->
len
if
(
cf
.
length
>
cols
->
len
)
{
&&
dict_col_in_v_indexes
(
table
,
cols
))
{
return
(
true
);
return
(
true
);
}
}
}
}
...
...
storage/innobase/include/fts0fts.h
View file @
850b2ba1
/*****************************************************************************
/*****************************************************************************
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2011, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 202
0
, MariaDB Corporation.
Copyright (c) 2016, 202
1
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
the terms of the GNU General Public License as published by the Free Software
...
@@ -932,16 +932,6 @@ fts_check_cached_index(
...
@@ -932,16 +932,6 @@ fts_check_cached_index(
/*===================*/
/*===================*/
dict_table_t
*
table
);
/*!< in: Table where indexes are dropped */
dict_table_t
*
table
);
/*!< in: Table where indexes are dropped */
/** Check if the all the auxillary tables associated with FTS index are in
consistent state. For now consistency is check only by ensuring
index->page_no != FIL_NULL
@param[out] base_table table has host fts index
@param[in,out] trx trx handler */
void
fts_check_corrupt
(
dict_table_t
*
base_table
,
trx_t
*
trx
);
/** Fetch the document from tuple, tokenize the text data and
/** Fetch the document from tuple, tokenize the text data and
insert the text data into fts auxiliary table and
insert the text data into fts auxiliary table and
its cache. Moreover this tuple fields doesn't contain any information
its cache. Moreover this tuple fields doesn't contain any information
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment