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
6bfeace1
Commit
6bfeace1
authored
Jul 19, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15759 Expect "Impossible WHERE" for indexed_int_column=out_of_range_int_constant
parent
25410d44
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
2 deletions
+66
-2
mysql-test/main/type_bit.result
mysql-test/main/type_bit.result
+18
-0
mysql-test/main/type_bit.test
mysql-test/main/type_bit.test
+18
-0
mysql-test/main/type_int.result
mysql-test/main/type_int.result
+12
-0
mysql-test/main/type_int.test
mysql-test/main/type_int.test
+11
-0
mysql-test/main/update.result
mysql-test/main/update.result
+2
-2
sql/opt_range.cc
sql/opt_range.cc
+5
-0
No files found.
mysql-test/main/type_bit.result
View file @
6bfeace1
...
@@ -849,3 +849,21 @@ DROP TABLE IF EXISTS t1;
...
@@ -849,3 +849,21 @@ DROP TABLE IF EXISTS t1;
#
#
# End of 10.2 tests
# End of 10.2 tests
#
#
#
# Start of 10.4 tests
#
#
# MDEV-15759 Expect "Impossible WHERE" for indexed_int_column=out_of_range_int_constant
#
CREATE TABLE t1 (a BIT(7), KEY(a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
EXPLAIN SELECT * FROM t1 WHERE a=200;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE a<=>200;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
#
# End of 10.4 tests
#
mysql-test/main/type_bit.test
View file @
6bfeace1
...
@@ -483,3 +483,21 @@ DROP TABLE IF EXISTS t1;
...
@@ -483,3 +483,21 @@ DROP TABLE IF EXISTS t1;
--
echo
# End of 10.2 tests
--
echo
# End of 10.2 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# Start of 10.4 tests
--
echo
#
--
echo
#
--
echo
# MDEV-15759 Expect "Impossible WHERE" for indexed_int_column=out_of_range_int_constant
--
echo
#
CREATE
TABLE
t1
(
a
BIT
(
7
),
KEY
(
a
));
INSERT
INTO
t1
VALUES
(
1
),(
2
),(
3
),(
4
),(
5
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
=
200
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
<=>
200
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.4 tests
--
echo
#
mysql-test/main/type_int.result
View file @
6bfeace1
...
@@ -268,5 +268,17 @@ Warnings:
...
@@ -268,5 +268,17 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 1
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 1
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-15759 Expect "Impossible WHERE" for indexed_int_column=out_of_range_int_constant
#
CREATE TABLE t1 (a TINYINT, KEY(a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
EXPLAIN SELECT * FROM t1 WHERE a=200;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE a<=>200;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
#
# End of 10.4 tests
# End of 10.4 tests
#
#
mysql-test/main/type_int.test
View file @
6bfeace1
...
@@ -196,6 +196,17 @@ EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE ?+a<=>1+a' USING 1;
...
@@ -196,6 +196,17 @@ EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE ?+a<=>1+a' USING 1;
EXECUTE
IMMEDIATE
'EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1+a<=>?+a'
USING
1
;
EXECUTE
IMMEDIATE
'EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1+a<=>?+a'
USING
1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-15759 Expect "Impossible WHERE" for indexed_int_column=out_of_range_int_constant
--
echo
#
CREATE
TABLE
t1
(
a
TINYINT
,
KEY
(
a
));
INSERT
INTO
t1
VALUES
(
1
),(
2
),(
3
),(
4
),(
5
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
=
200
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
<=>
200
;
DROP
TABLE
t1
;
--
echo
#
--
echo
#
--
echo
# End of 10.4 tests
--
echo
# End of 10.4 tests
--
echo
#
--
echo
#
mysql-test/main/update.result
View file @
6bfeace1
...
@@ -447,7 +447,7 @@ UPDATE t1 SET user_id=null WHERE request_id=9999999999999;
...
@@ -447,7 +447,7 @@ UPDATE t1 SET user_id=null WHERE request_id=9999999999999;
show status like '%Handler_read%';
show status like '%Handler_read%';
Variable_name Value
Variable_name Value
Handler_read_first 0
Handler_read_first 0
Handler_read_key
3
Handler_read_key
2
Handler_read_last 0
Handler_read_last 0
Handler_read_next 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_prev 0
...
@@ -459,7 +459,7 @@ UPDATE t1 SET user_id=null WHERE request_id=999999999999999999999999999999;
...
@@ -459,7 +459,7 @@ UPDATE t1 SET user_id=null WHERE request_id=999999999999999999999999999999;
show status like '%Handler_read%';
show status like '%Handler_read%';
Variable_name Value
Variable_name Value
Handler_read_first 0
Handler_read_first 0
Handler_read_key
3
Handler_read_key
2
Handler_read_last 0
Handler_read_last 0
Handler_read_next 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_prev 0
...
...
sql/opt_range.cc
View file @
6bfeace1
...
@@ -8114,6 +8114,11 @@ Item_bool_func::get_mm_leaf(RANGE_OPT_PARAM *param,
...
@@ -8114,6 +8114,11 @@ Item_bool_func::get_mm_leaf(RANGE_OPT_PARAM *param,
*/
*/
else
if
(
err
==
1
&&
field
->
result_type
()
==
INT_RESULT
)
else
if
(
err
==
1
&&
field
->
result_type
()
==
INT_RESULT
)
{
{
if
(
type
==
EQ_FUNC
||
type
==
EQUAL_FUNC
)
// e.g. tinyint = 200
{
tree
=
new
(
alloc
)
SEL_ARG_IMPOSSIBLE
(
field
);
goto
end
;
}
if
(
type
==
LT_FUNC
&&
(
value
->
val_int
()
>
0
))
if
(
type
==
LT_FUNC
&&
(
value
->
val_int
()
>
0
))
type
=
LE_FUNC
;
type
=
LE_FUNC
;
else
if
(
type
==
GT_FUNC
&&
else
if
(
type
==
GT_FUNC
&&
...
...
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