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
f0e9bebd
Commit
f0e9bebd
authored
Sep 26, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13897 SELECT
@A
:= MAX(col) FROM t requires full index scan
fix some old bad merge
parent
5b01b88e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
mysql-test/r/join_cache.result
mysql-test/r/join_cache.result
+1
-1
mysql-test/r/user_var.result
mysql-test/r/user_var.result
+9
-7
mysql-test/r/variables.result
mysql-test/r/variables.result
+2
-2
mysql-test/t/user_var.test
mysql-test/t/user_var.test
+7
-3
sql/item_func.h
sql/item_func.h
+0
-6
No files found.
mysql-test/r/join_cache.result
View file @
f0e9bebd
...
...
@@ -5880,7 +5880,7 @@ where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@co
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
2 UNCACHEABLE SUBQUERY
t3 system NULL NULL NULL NULL 1
2 UNCACHEABLE SUBQUERY
NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
set @counter=0;
select count(*) from t1 straight_join t2
where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@counter+1);
...
...
mysql-test/r/user_var.result
View file @
f0e9bebd
drop table if exists t1,t2;
set @a := foo;
ERROR 42S22: Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
...
...
@@ -126,14 +125,14 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
set @a=0;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
0 hello 0 3
3
hello again
0 hello 0 3
3
hello again
0 hello 0 3
3
hello again
0 hello 0 3
0
hello again
0 hello 0 3
0
hello again
0 hello 0 3
0
hello again
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
hello again hello hello
3 3
hello again
hello again hello hello
3 3
hello again
hello again hello hello
3 3
hello again
hello again hello hello
again 3 hello again
hello again
hello again hello hello
again 3 hello again
hello again
hello again hello hello
again 3 hello again
hello again
drop table t1;
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
...
...
@@ -570,3 +569,6 @@ End of 5.5 tests
#
set @var= repeat('a',20000);
1
explain select @a:=max(seq) from seq_1_to_1000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
mysql-test/r/variables.result
View file @
f0e9bebd
...
...
@@ -1544,7 +1544,7 @@ one
1
explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
Using temporary; Using filesort
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
one
...
...
@@ -1555,7 +1555,7 @@ one
set sql_buffer_result=1;
explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary
; Using filesort
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
one
...
...
mysql-test/t/user_var.test
View file @
f0e9bebd
# Initialise
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
source
include
/
have_sequence
.
inc
;
--
error
1054
set
@
a
:=
foo
;
...
...
@@ -501,3 +499,9 @@ eval select $tmp < $tmp2;
--
enable_column_names
--
enable_query_log
#
# MDEV-13897 SELECT @a := MAX(col) FROM t requires full index scan
#
explain
select
@
a
:=
max
(
seq
)
from
seq_1_to_1000000
;
# End of 10.1 tests
sql/item_func.h
View file @
f0e9bebd
...
...
@@ -1773,12 +1773,6 @@ class Item_func_set_user_var :public Item_func_user_var
create_tmp_field
(
false
,
table
,
MY_INT32_NUM_DECIMAL_DIGITS
)
:
tmp_table_field_from_field_type
(
table
,
false
,
true
);
}
table_map
used_tables
()
const
{
return
used_tables_cache
|
RAND_TABLE_BIT
;
}
bool
const_item
()
const
{
return
0
;
}
bool
is_expensive
()
{
return
1
;
}
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
void
print_as_stmt
(
String
*
str
,
enum_query_type
query_type
);
const
char
*
func_name
()
const
{
return
"set_user_var"
;
}
...
...
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