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
34762401
Commit
34762401
authored
May 05, 2023
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.8' into 10.9
parents
2871a05c
2668d596
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
mysql-test/main/selectivity_no_engine.result
mysql-test/main/selectivity_no_engine.result
+23
-0
mysql-test/main/selectivity_no_engine.test
mysql-test/main/selectivity_no_engine.test
+20
-0
sql/field.cc
sql/field.cc
+1
-0
No files found.
mysql-test/main/selectivity_no_engine.result
View file @
34762401
...
...
@@ -314,6 +314,29 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a ALL NULL NULL NULL NULL 5 Using where
1 SIMPLE b hash_ALL NULL #hash#$hj 1341 test.a.Host,test.a.User,test.a.Password,test.a.Select_priv,test.a.Insert_priv,test.a.Update_priv,test.a.Delete_priv,test.a.Create_priv,test.a.Drop_priv,test.a.Reload_priv,test.a.Shutdown_priv,test.a.Process_priv,test.a.File_priv,test.a.Grant_priv,test.a.References_priv,test.a.Index_priv,test.a.Alter_priv,test.a.Show_db_priv,test.a.Super_priv,test.a.Create_tmp_table_priv,test.a.Lock_tables_priv,test.a.Execute_priv,test.a.Repl_slave_priv,test.a.Repl_client_priv,test.a.Create_view_priv,test.a.Show_view_priv,test.a.Create_routine_priv,test.a.Alter_routine_priv,test.a.Create_user_priv,test.a.Event_priv,test.a.Trigger_priv,test.a.Create_tablespace_priv,test.a.Delete_history_priv,test.a.ssl_type,test.a.ssl_cipher,test.a.x509_issuer,test.a.x509_subject,test.a.max_questions,test.a.max_updates,test.a.max_connections,test.a.max_user_connections,test.a.plugin,test.a.authentication_string,test.a.password_expired,test.a.is_role,test.a.default_role,test.a.max_statement_time 5 Using where; Using join buffer (flat, BNLH join)
DROP TABLE t1,t2,t3;
#
# MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
#
CREATE TABLE t1 (a VARCHAR(255));
INSERT INTO t1 VALUES ('u'),('uu');
CREATE TABLE t2 (b VARCHAR(255)) CHARACTER SET utf8mb4;
INSERT INTO t2 VALUES ('x'),('xx');
CREATE TABLE t3 (c VARCHAR(255));
INSERT INTO t3 VALUES ('z'),('zz');
ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
set @tmp1=@@optimizer_switch, @tmp2=@@join_cache_level;
set optimizer_switch='hash_join_cardinality=on', join_cache_level=3;
SELECT t1.* FROM t1 JOIN (SELECT DISTINCT b FROM t2 JOIN t3) sq ON sq.b = t1.a;
a
set optimizer_switch=@tmp1, join_cache_level=@tmp2;
DROP TABLE t1, t2, t3;
#
# End of the test file
#
...
...
mysql-test/main/selectivity_no_engine.test
View file @
34762401
...
...
@@ -250,6 +250,26 @@ SELECT * FROM t1 AS a NATURAL JOIN t1 AS b;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
# MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
255
));
INSERT
INTO
t1
VALUES
(
'u'
),(
'uu'
);
CREATE
TABLE
t2
(
b
VARCHAR
(
255
))
CHARACTER
SET
utf8mb4
;
INSERT
INTO
t2
VALUES
(
'x'
),(
'xx'
);
CREATE
TABLE
t3
(
c
VARCHAR
(
255
));
INSERT
INTO
t3
VALUES
(
'z'
),(
'zz'
);
ANALYZE
TABLE
t1
,
t2
,
t3
PERSISTENT
FOR
ALL
;
# Optional, fails either way
set
@
tmp1
=@@
optimizer_switch
,
@
tmp2
=@@
join_cache_level
;
set
optimizer_switch
=
'hash_join_cardinality=on'
,
join_cache_level
=
3
;
SELECT
t1
.*
FROM
t1
JOIN
(
SELECT
DISTINCT
b
FROM
t2
JOIN
t3
)
sq
ON
sq
.
b
=
t1
.
a
;
set
optimizer_switch
=@
tmp1
,
join_cache_level
=@
tmp2
;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
# End of the test file
--
echo
#
...
...
sql/field.cc
View file @
34762401
...
...
@@ -2557,6 +2557,7 @@ Field *Field::make_new_field(MEM_ROOT *root, TABLE *new_table,
tmp
->
key_start
.
init
(
0
);
tmp
->
part_of_key
.
init
(
0
);
tmp
->
part_of_sortkey
.
init
(
0
);
tmp
->
read_stats
=
NULL
;
/*
TODO: it is not clear why this method needs to reset unireg_check.
Try not to reset it, or explain why it needs to be reset.
...
...
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