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
217faf56
Commit
217faf56
authored
Jun 20, 2006
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
parents
609e0dbd
6777928e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+4
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+13
-0
sql/sql_select.cc
sql/sql_select.cc
+8
-4
No files found.
mysql-test/r/insert_select.result
View file @
217faf56
...
@@ -686,3 +686,7 @@ ERROR 42S22: Unknown column 'z' in 'field list'
...
@@ -686,3 +686,7 @@ ERROR 42S22: Unknown column 'z' in 'field list'
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
ERROR 42S02: Unknown table 't2' in field list
ERROR 42S02: Unknown table 't2' in field list
drop table t1,t2;
drop table t1,t2;
CREATE TABLE t1 (a int PRIMARY KEY);
INSERT INTO t1 values (1), (2);
INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
DROP TABLE t1;
mysql-test/t/insert_select.test
View file @
217faf56
...
@@ -226,4 +226,17 @@ insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
...
@@ -226,4 +226,17 @@ insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
insert
into
t1
(
x
,
y
)
select
x
,
z
from
t2
on
duplicate
key
update
x
=
values
(
t2
.
x
);
insert
into
t1
(
x
,
y
)
select
x
,
z
from
t2
on
duplicate
key
update
x
=
values
(
t2
.
x
);
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
# tables
#
#Note: not an exsaustive test : just a check of the code path.
CREATE
TABLE
t1
(
a
int
PRIMARY
KEY
);
INSERT
INTO
t1
values
(
1
),
(
2
);
INSERT
INTO
t1
SELECT
a
+
2
FROM
t1
LIMIT
1
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/sql_select.cc
View file @
217faf56
...
@@ -888,8 +888,9 @@ JOIN::optimize()
...
@@ -888,8 +888,9 @@ JOIN::optimize()
group_list
?
0
:
select_distinct
,
group_list
?
0
:
select_distinct
,
group_list
&&
simple_group
,
group_list
&&
simple_group
,
select_options
,
select_options
,
(
order
==
0
||
skip_sort_order
)
?
select_limit
:
(
order
==
0
||
skip_sort_order
||
HA_POS_ERROR
,
test
(
select_options
&
OPTION_BUFFER_RESULT
))
?
select_limit
:
HA_POS_ERROR
,
(
char
*
)
""
)))
(
char
*
)
""
)))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
@@ -5530,6 +5531,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -5530,6 +5531,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
keyinfo
->
key_length
+=
key_part_info
->
length
;
keyinfo
->
key_length
+=
key_part_info
->
length
;
}
}
}
}
else
{
set_if_smaller
(
table
->
max_rows
,
rows_limit
);
param
->
end_write_records
=
rows_limit
;
}
if
(
distinct
&&
field_count
!=
param
->
hidden_field_count
)
if
(
distinct
&&
field_count
!=
param
->
hidden_field_count
)
{
{
...
@@ -5544,8 +5550,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -5544,8 +5550,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
null_pack_length
-=
hidden_null_pack_length
;
null_pack_length
-=
hidden_null_pack_length
;
keyinfo
->
key_parts
=
((
field_count
-
param
->
hidden_field_count
)
+
keyinfo
->
key_parts
=
((
field_count
-
param
->
hidden_field_count
)
+
test
(
null_pack_length
));
test
(
null_pack_length
));
set_if_smaller
(
table
->
max_rows
,
rows_limit
);
param
->
end_write_records
=
rows_limit
;
table
->
distinct
=
1
;
table
->
distinct
=
1
;
table
->
keys
=
1
;
table
->
keys
=
1
;
if
(
blob_count
)
if
(
blob_count
)
...
...
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