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
98911707
Commit
98911707
authored
Nov 19, 2006
by
holyfoot/hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/hf/work/mysql-5.0-0mrg
into mysql.com:/home/hf/work/mysql-5.1-mrg
parents
bc840a7f
dac2d0fc
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
176 additions
and
15 deletions
+176
-15
client/mysqltest.c
client/mysqltest.c
+0
-1
mysql-test/r/metadata.result
mysql-test/r/metadata.result
+34
-0
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+7
-7
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+48
-0
mysql-test/t/metadata.test
mysql-test/t/metadata.test
+19
-0
mysql-test/t/mysql.test
mysql-test/t/mysql.test
+18
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+4
-5
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+29
-0
sql/item.cc
sql/item.cc
+4
-0
sql/sql_parse.cc
sql/sql_parse.cc
+4
-0
sql/sql_select.cc
sql/sql_select.cc
+9
-2
No files found.
client/mysqltest.c
View file @
98911707
...
@@ -475,7 +475,6 @@ void handle_error(struct st_command*,
...
@@ -475,7 +475,6 @@ void handle_error(struct st_command*,
const
char
*
err_sqlstate
,
DYNAMIC_STRING
*
ds
);
const
char
*
err_sqlstate
,
DYNAMIC_STRING
*
ds
);
void
handle_no_error
(
struct
st_command
*
);
void
handle_no_error
(
struct
st_command
*
);
#ifdef EMBEDDED_LIBRARY
#ifdef EMBEDDED_LIBRARY
/*
/*
send_one_query executes query in separate thread what is
send_one_query executes query in separate thread what is
...
...
mysql-test/r/metadata.result
View file @
98911707
...
@@ -96,3 +96,37 @@ i
...
@@ -96,3 +96,37 @@ i
2
2
affected rows: 1
affected rows: 1
affected rows: 0
affected rows: 0
create table t1 (id int(10));
insert into t1 values (1);
CREATE VIEW v1 AS select t1.id as id from t1;
CREATE VIEW v2 AS select t1.id as renamed from t1;
CREATE VIEW v3 AS select t1.id + 12 as renamed from t1;
select * from v1 group by id limit 1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 id id 3 10 1 Y 32768 0 63
id
1
select * from v1 group by id limit 0;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 id id 3 10 0 Y 32768 0 63
id
select * from v1 where id=1000 group by id;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 id id 3 10 0 Y 32768 0 63
id
select * from v1 where id=1 group by id;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 id id 3 10 1 Y 32768 0 63
id
1
select * from v2 where renamed=1 group by renamed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v2 id renamed 3 10 1 Y 32768 0 63
renamed
1
select * from v3 where renamed=1 group by renamed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def v3 renamed 8 12 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
mysql-test/r/order_by.result
View file @
98911707
...
@@ -760,13 +760,6 @@ xxxxxxxxxxxxxxxxxxxaa
...
@@ -760,13 +760,6 @@ xxxxxxxxxxxxxxxxxxxaa
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxz
xxxxxxxxxxxxxxxxxxxz
drop table t1;
drop table t1;
create table t1 (a int not null, b int not null, c int not null);
insert t1 values (1,1,1),(1,1,2),(1,2,1);
select a, b from t1 group by a, b order by sum(c);
a b
1 2
1 1
drop table t1;
create table t1 (
create table t1 (
`sid` decimal(8,0) default null,
`sid` decimal(8,0) default null,
`wnid` varchar(11) not null default '',
`wnid` varchar(11) not null default '',
...
@@ -881,6 +874,13 @@ num (select num + 2 FROM t1 LIMIT 1)
...
@@ -881,6 +874,13 @@ num (select num + 2 FROM t1 LIMIT 1)
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
ERROR 42S22: Unknown column 'num' in 'on clause'
ERROR 42S22: Unknown column 'num' in 'on clause'
DROP TABLE t1;
DROP TABLE t1;
create table t1 (a int not null, b int not null, c int not null);
insert t1 values (1,1,1),(1,1,2),(1,2,1);
select a, b from t1 group by a, b order by sum(c);
a b
1 2
1 1
drop table t1;
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a));
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a));
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
explain SELECT t1.b as a, t2.b as c FROM
explain SELECT t1.b as a, t2.b as c FROM
...
...
mysql-test/r/query_cache.result
View file @
98911707
...
@@ -1276,3 +1276,51 @@ Variable_name Value
...
@@ -1276,3 +1276,51 @@ Variable_name Value
Last_query_cost 0.000000
Last_query_cost 0.000000
drop table t1;
drop table t1;
SET GLOBAL query_cache_size=0;
SET GLOBAL query_cache_size=0;
set global query_cache_size=1024*1024;
flush status;
create table t1 (a int);
insert into t1 (a) values (1), (2), (3);
select * from t1;
a
1
2
3
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 0
select * from t1;
a
1
2
3
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 1
create table t2 like t1;
select * from t1;
a
1
2
3
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 2
insert into t2 select * from t1;
select * from t1;
a
1
2
3
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 3
drop table t1, t2;
create table t1(c1 int);
create table t2(c1 int);
create table t3(c1 int);
create view v1 as select t3.c1 as c1 from t3,t2 where t3.c1 = t2.c1;
start transaction;
insert into t1(c1) select c1 from v1;
drop table t1, t2, t3;
drop view v1;
set global query_cache_size=0;
mysql-test/t/metadata.test
View file @
98911707
...
@@ -61,4 +61,23 @@ drop table t1;//
...
@@ -61,4 +61,23 @@ drop table t1;//
delimiter
;
//
delimiter
;
//
--
disable_info
--
disable_info
#
# Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
#
--
enable_metadata
create
table
t1
(
id
int
(
10
));
insert
into
t1
values
(
1
);
CREATE
VIEW
v1
AS
select
t1
.
id
as
id
from
t1
;
CREATE
VIEW
v2
AS
select
t1
.
id
as
renamed
from
t1
;
CREATE
VIEW
v3
AS
select
t1
.
id
+
12
as
renamed
from
t1
;
select
*
from
v1
group
by
id
limit
1
;
select
*
from
v1
group
by
id
limit
0
;
select
*
from
v1
where
id
=
1000
group
by
id
;
select
*
from
v1
where
id
=
1
group
by
id
;
select
*
from
v2
where
renamed
=
1
group
by
renamed
;
select
*
from
v3
where
renamed
=
1
group
by
renamed
;
drop
table
t1
;
drop
view
v1
,
v2
,
v3
;
--
disable_metadata
# End of 4.1 tests
# End of 4.1 tests
mysql-test/t/mysql.test
View file @
98911707
...
@@ -142,6 +142,24 @@ drop table t1;
...
@@ -142,6 +142,24 @@ drop table t1;
--
exec
$MYSQL
-
e
'help '
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20328_2
.
result
--
exec
$MYSQL
-
e
'help '
>
$MYSQLTEST_VARDIR
/
tmp
/
bug20328_2
.
result
--
exec
diff
$MYSQLTEST_VARDIR
/
tmp
/
bug20328_1
.
result
$MYSQLTEST_VARDIR
/
tmp
/
bug20328_2
.
result
--
exec
diff
$MYSQLTEST_VARDIR
/
tmp
/
bug20328_1
.
result
$MYSQLTEST_VARDIR
/
tmp
/
bug20328_2
.
result
#
# Bug #19216: Client crashes on long SELECT
#
--
exec
echo
"select"
>
$MYSQLTEST_VARDIR
/
tmp
/
b19216
.
tmp
# 3400 * 20 makes 68000 columns that is more than the max number that can fit
# in a 16 bit number.
let
$i
=
3400
;
while
(
$i
)
{
--
exec
echo
"'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',"
>>
$MYSQLTEST_VARDIR
/
tmp
/
b19216
.
tmp
dec
$i
;
}
--
exec
echo
"'b';"
>>
$MYSQLTEST_VARDIR
/
tmp
/
b19216
.
tmp
--
disable_query_log
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
b19216
.
tmp
>/
dev
/
null
--
enable_query_log
#
#
# Bug #20103: Escaping with backslash does not work
# Bug #20103: Escaping with backslash does not work
#
#
...
...
mysql-test/t/order_by.test
View file @
98911707
...
@@ -514,11 +514,6 @@ set max_sort_length=20;
...
@@ -514,11 +514,6 @@ set max_sort_length=20;
select
a
from
t1
order
by
a
;
select
a
from
t1
order
by
a
;
drop
table
t1
;
drop
table
t1
;
create
table
t1
(
a
int
not
null
,
b
int
not
null
,
c
int
not
null
);
insert
t1
values
(
1
,
1
,
1
),(
1
,
1
,
2
),(
1
,
2
,
1
);
select
a
,
b
from
t1
group
by
a
,
b
order
by
sum
(
c
);
drop
table
t1
;
#
#
# Bug #7331
# Bug #7331
#
#
...
@@ -594,6 +589,10 @@ SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
...
@@ -594,6 +589,10 @@ SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
create
table
t1
(
a
int
not
null
,
b
int
not
null
,
c
int
not
null
);
insert
t1
values
(
1
,
1
,
1
),(
1
,
1
,
2
),(
1
,
2
,
1
);
select
a
,
b
from
t1
group
by
a
,
b
order
by
sum
(
c
);
drop
table
t1
;
#
#
# Bug#21302: Result not properly sorted when using an ORDER BY on a second
# Bug#21302: Result not properly sorted when using an ORDER BY on a second
...
...
mysql-test/t/query_cache.test
View file @
98911707
...
@@ -877,3 +877,32 @@ select * from t1 where a > 3;
...
@@ -877,3 +877,32 @@ select * from t1 where a > 3;
show
status
like
'last_query_cost'
;
show
status
like
'last_query_cost'
;
drop
table
t1
;
drop
table
t1
;
SET
GLOBAL
query_cache_size
=
0
;
SET
GLOBAL
query_cache_size
=
0
;
#
# Bug #20045: Server crash on INSERT ... SELECT ... FROM non-mergeable view
#
set
global
query_cache_size
=
1024
*
1024
;
flush
status
;
create
table
t1
(
a
int
);
insert
into
t1
(
a
)
values
(
1
),
(
2
),
(
3
);
select
*
from
t1
;
show
status
like
'Qcache_hits'
;
select
*
from
t1
;
show
status
like
'Qcache_hits'
;
create
table
t2
like
t1
;
select
*
from
t1
;
show
status
like
'Qcache_hits'
;
insert
into
t2
select
*
from
t1
;
select
*
from
t1
;
show
status
like
'Qcache_hits'
;
drop
table
t1
,
t2
;
create
table
t1
(
c1
int
);
create
table
t2
(
c1
int
);
create
table
t3
(
c1
int
);
create
view
v1
as
select
t3
.
c1
as
c1
from
t3
,
t2
where
t3
.
c1
=
t2
.
c1
;
start
transaction
;
insert
into
t1
(
c1
)
select
c1
from
v1
;
drop
table
t1
,
t2
,
t3
;
drop
view
v1
;
set
global
query_cache_size
=
0
;
sql/item.cc
View file @
98911707
...
@@ -4288,6 +4288,10 @@ void Item_field::make_field(Send_field *tmp_field)
...
@@ -4288,6 +4288,10 @@ void Item_field::make_field(Send_field *tmp_field)
DBUG_ASSERT
(
tmp_field
->
table_name
!=
0
);
DBUG_ASSERT
(
tmp_field
->
table_name
!=
0
);
if
(
name
)
if
(
name
)
tmp_field
->
col_name
=
name
;
// Use user supplied name
tmp_field
->
col_name
=
name
;
// Use user supplied name
if
(
table_name
)
tmp_field
->
table_name
=
table_name
;
if
(
db_name
)
tmp_field
->
db_name
=
db_name
;
}
}
...
...
sql/sql_parse.cc
View file @
98911707
...
@@ -3475,8 +3475,12 @@ mysql_execute_command(THD *thd)
...
@@ -3475,8 +3475,12 @@ mysql_execute_command(THD *thd)
if
(
first_table
->
lock_type
==
TL_WRITE_CONCURRENT_INSERT
&&
if
(
first_table
->
lock_type
==
TL_WRITE_CONCURRENT_INSERT
&&
thd
->
lock
)
thd
->
lock
)
{
{
/* INSERT ... SELECT should invalidate only the very first table */
TABLE_LIST
*
save_table
=
first_table
->
next_local
;
first_table
->
next_local
=
0
;
mysql_unlock_tables
(
thd
,
thd
->
lock
);
mysql_unlock_tables
(
thd
,
thd
->
lock
);
query_cache_invalidate3
(
thd
,
first_table
,
1
);
query_cache_invalidate3
(
thd
,
first_table
,
1
);
first_table
->
next_local
=
save_table
;
thd
->
lock
=
0
;
thd
->
lock
=
0
;
}
}
delete
result
;
delete
result
;
...
...
sql/sql_select.cc
View file @
98911707
...
@@ -13833,9 +13833,16 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
...
@@ -13833,9 +13833,16 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
if
(
real_pos
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
real_pos
->
type
()
==
Item
::
FIELD_ITEM
)
{
{
Item_field
*
item
;
Item_field
*
item
;
pos
=
real_pos
;
if
(
!
(
item
=
new
Item_field
(
thd
,
((
Item_field
*
)
real_pos
))))
if
(
!
(
item
=
new
Item_field
(
thd
,
((
Item_field
*
)
pos
))))
goto
err
;
goto
err
;
if
(
pos
->
type
()
==
Item
::
REF_ITEM
)
{
/* preserve the names of the ref when dereferncing */
Item_ref
*
ref
=
(
Item_ref
*
)
pos
;
item
->
db_name
=
ref
->
db_name
;
item
->
table_name
=
ref
->
table_name
;
item
->
name
=
ref
->
name
;
}
pos
=
item
;
pos
=
item
;
if
(
item
->
field
->
flags
&
BLOB_FLAG
)
if
(
item
->
field
->
flags
&
BLOB_FLAG
)
{
{
...
...
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