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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
25090a6d
Commit
25090a6d
authored
May 18, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-4.1
into mysql.com:/d2/hf/mrg/mysql-4.1-opt
parents
42dae8f5
8762539d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
0 deletions
+97
-0
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+21
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+22
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+25
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+18
-0
sql/sql_select.cc
sql/sql_select.cc
+6
-0
sql/sql_union.cc
sql/sql_union.cc
+5
-0
No files found.
mysql-test/r/innodb_mysql.result
View file @
25090a6d
...
...
@@ -161,4 +161,25 @@ SELECT * FROM t1;
c1 cnt
1a 2
DROP TABLE t1;
CREATE TABLE t1 (
a1 decimal(10,0) DEFAULT NULL,
a2 blob,
a3 time DEFAULT NULL,
a4 blob,
a5 char(175) DEFAULT NULL,
a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
a7 tinyblob,
INDEX idx (a6,a7(239),a5)
) ENGINE=InnoDB;
EXPLAIN SELECT a4 FROM t1 WHERE
a6=NULL AND
a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
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 t1.a4 FROM t1, t1 t WHERE
t.a6=t.a6 AND t1.a6=NULL AND
t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
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 4.1 tests
mysql-test/r/ps.result
View file @
25090a6d
...
...
@@ -1087,4 +1087,26 @@ t2 CREATE TABLE `t2` (
drop database mysqltest;
deallocate prepare stmt1;
deallocate prepare stmt2;
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (2), (3), (1);
PREPARE st1 FROM
'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a';
EXECUTE st1;
a
1
2
3
11
12
13
EXECUTE st1;
a
1
2
3
11
12
13
DEALLOCATE PREPARE st1;
DROP TABLE t1;
End of 4.1 tests.
mysql-test/t/innodb_mysql.test
View file @
25090a6d
...
...
@@ -191,4 +191,29 @@ INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
#
# Bug #28272: EXPLAIN for SELECT from an empty InnoDB table
#
CREATE
TABLE
t1
(
a1
decimal
(
10
,
0
)
DEFAULT
NULL
,
a2
blob
,
a3
time
DEFAULT
NULL
,
a4
blob
,
a5
char
(
175
)
DEFAULT
NULL
,
a6
timestamp
NOT
NULL
DEFAULT
'0000-00-00 00:00:00'
,
a7
tinyblob
,
INDEX
idx
(
a6
,
a7
(
239
),
a5
)
)
ENGINE
=
InnoDB
;
EXPLAIN
SELECT
a4
FROM
t1
WHERE
a6
=
NULL
AND
a4
=
'UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'
;
EXPLAIN
SELECT
t1
.
a4
FROM
t1
,
t1
t
WHERE
t
.
a6
=
t
.
a6
AND
t1
.
a6
=
NULL
AND
t1
.
a4
=
'UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'
;
DROP
TABLE
t1
;
--
echo
End
of
4.1
tests
mysql-test/t/ps.test
View file @
25090a6d
...
...
@@ -1128,4 +1128,22 @@ drop database mysqltest;
deallocate
prepare
stmt1
;
deallocate
prepare
stmt2
;
#
#
# Bug #27937: crash on the second execution for prepared statement
# from UNION with ORDER BY an expression containing RAND()
#
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
2
),
(
3
),
(
1
);
PREPARE
st1
FROM
'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a'
;
EXECUTE
st1
;
EXECUTE
st1
;
DEALLOCATE
PREPARE
st1
;
DROP
TABLE
t1
;
--
echo
End
of
4.1
tests
.
sql/sql_select.cc
View file @
25090a6d
...
...
@@ -634,6 +634,12 @@ JOIN::optimize()
DBUG_PRINT
(
"error"
,(
"Error: make_select() failed"
));
DBUG_RETURN
(
1
);
}
if
(
conds
&&!
outer_join
&&
const_table_map
!=
found_const_table_map
&&
(
select_options
&
SELECT_DESCRIBE
)
&&
select_lex
->
master_unit
()
==
&
thd
->
lex
->
unit
)
// upper level SELECT
{
conds
=
new
Item_int
((
longlong
)
0
,
1
);
// Always false
}
if
(
make_join_select
(
this
,
select
,
conds
))
{
zero_result_cause
=
...
...
sql/sql_union.cc
View file @
25090a6d
...
...
@@ -135,6 +135,11 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd)
fake_select_lex
->
table_list
.
link_in_list
((
byte
*
)
&
result_table_list
,
(
byte
**
)
&
result_table_list
.
next
);
for
(
ORDER
*
order
=
(
ORDER
*
)
global_parameters
->
order_list
.
first
;
order
;
order
=
order
->
next
)
order
->
item
=
&
order
->
item_ptr
;
return
options_tmp
;
}
...
...
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