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
89d01ca0
Commit
89d01ca0
authored
Dec 17, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
7d2b182d
8165ea21
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
325 additions
and
91 deletions
+325
-91
mysql-test/collections/default.push
mysql-test/collections/default.push
+2
-2
mysql-test/r/federated_bug_35333.result
mysql-test/r/federated_bug_35333.result
+76
-0
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+18
-0
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+2
-0
mysql-test/r/information_schema_db.result
mysql-test/r/information_schema_db.result
+4
-0
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+2
-0
mysql-test/r/view.result
mysql-test/r/view.result
+2
-0
mysql-test/t/federated_bug_35333.test
mysql-test/t/federated_bug_35333.test
+74
-0
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+14
-0
sql/item_sum.cc
sql/item_sum.cc
+18
-1
sql/sql_show.cc
sql/sql_show.cc
+113
-87
sql/table.h
sql/table.h
+0
-1
No files found.
mysql-test/collections/default.push
View file @
89d01ca0
perl mysql-test-run.pl --timer --force --comment=n_stm
perl mysql-test-run.pl --timer --force --
vardir=var-n_stm --
comment=n_stm
perl mysql-test-run.pl --timer --force --comment=ps_stm --ps-protocol
perl mysql-test-run.pl --timer --force --
vardir=var-ps_stm --
comment=ps_stm --ps-protocol
mysql-test/r/federated_bug_35333.result
0 → 100644
View file @
89d01ca0
#
# Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata"
#
# Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail
# when encountering a federated table that cannot connect to its remote table.
#
# The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear
# the remote connection error and push a warning instead. This allows the SELECT operation
# to complete while still indicating a problem. This fix applies to any non-fatal system
# error that occurs during a query against I_S.TABLES.de
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
CREATE DATABASE IF NOT EXISTS realdb;
DROP TABLE IF EXISTS realdb.t0;
DROP TABLE IF EXISTS federated.t0;
#
# Create the base table to be referenced
#
CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM;
#
# Create a federated table with a bogus port number
#
CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0';
#
# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query
#
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated';
TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT
federated t0 NULL NULL NULL NULL Unable to connect to foreign data source: Can't connect to MySQL server on '127.
realdb t0 BASE TABLE MyISAM Dynamic 0 0
Warnings:
Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
SHOW WARNINGS;
Level Code Message
Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
#
# Create a MyISAM table then corrupt the file
#
USE realdb;
CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
#
# Corrupt the MyISAM table by deleting the base file
#
#
# Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query
#
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT
realdb t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2)
Warnings:
Warning 1017 Can't find file: 't1' (errno: 2)
SHOW WARNINGS;
Level Code Message
Warning 1017 Can't find file: 't1' (errno: 2)
#
# Cleanup
#
DROP TABLE IF EXISTS realdb.t0;
DROP TABLE IF EXISTS federated.t0;
DROP DATABASE realdb;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
mysql-test/r/func_gconcat.result
View file @
89d01ca0
...
@@ -989,4 +989,22 @@ SELECT 1 FROM
...
@@ -989,4 +989,22 @@ SELECT 1 FROM
1
1
1
1
DROP TABLE t1;
DROP TABLE t1;
#
# Bug #54476: crash when group_concat and 'with rollup' in prepared statements
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2);
PREPARE stmt FROM "SELECT GROUP_CONCAT(t1.a ORDER BY t1.a) FROM t1 JOIN t1 t2 GROUP BY t1.a WITH ROLLUP";
EXECUTE stmt;
GROUP_CONCAT(t1.a ORDER BY t1.a)
1,1
2,2
1,1,2,2
EXECUTE stmt;
GROUP_CONCAT(t1.a ORDER BY t1.a)
1,1
2,2
1,1,2,2
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
mysql-test/r/information_schema.result
View file @
89d01ca0
...
@@ -1053,6 +1053,8 @@ select table_type from information_schema.tables
...
@@ -1053,6 +1053,8 @@ select table_type from information_schema.tables
where table_name="v1";
where table_name="v1";
table_type
table_type
VIEW
VIEW
Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v1;
drop view v1;
create temporary table t1(f1 int, index(f1));
create temporary table t1(f1 int, index(f1));
show columns from t1;
show columns from t1;
...
...
mysql-test/r/information_schema_db.result
View file @
89d01ca0
...
@@ -65,10 +65,14 @@ select table_name, table_type, table_comment from information_schema.tables
...
@@ -65,10 +65,14 @@ select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
where table_schema='inf%' and func2();
table_name table_type table_comment
table_name table_type table_comment
v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
Warnings:
Warning 1356 View 'inf%.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select table_name, table_type, table_comment from information_schema.tables
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
where table_schema='inf%' and func2();
table_name table_type table_comment
table_name table_type table_comment
v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
Warnings:
Warning 1356 View 'inf%.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v1;
drop view v1;
drop function func1;
drop function func1;
drop function func2;
drop function func2;
...
...
mysql-test/r/show_check.result
View file @
89d01ca0
...
@@ -622,6 +622,8 @@ flush tables;
...
@@ -622,6 +622,8 @@ flush tables;
SHOW TABLE STATUS like 't1';
SHOW TABLE STATUS like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
Warnings:
Warning 1033 Incorrect information in file: './test/t1.frm'
show create table t1;
show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
ERROR HY000: Incorrect information in file: './test/t1.frm'
drop table t1;
drop table t1;
...
...
mysql-test/r/view.result
View file @
89d01ca0
...
@@ -840,6 +840,8 @@ show table status;
...
@@ -840,6 +840,8 @@ show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or define
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or define
Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v1;
drop view v1;
drop table t1;
drop table t1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
...
...
mysql-test/t/federated_bug_35333.test
0 → 100644
View file @
89d01ca0
--
echo
#
--
echo
# Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata"
--
echo
#
--
echo
# Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail
--
echo
# when encountering a federated table that cannot connect to its remote table.
--
echo
#
--
echo
# The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear
--
echo
# the remote connection error and push a warning instead. This allows the SELECT operation
--
echo
# to complete while still indicating a problem. This fix applies to any non-fatal system
--
echo
# error that occurs during a query against I_S.TABLES.de
--
source
include
/
federated
.
inc
--
disable_warnings
CREATE
DATABASE
IF
NOT
EXISTS
realdb
;
# Federated database exists
DROP
TABLE
IF
EXISTS
realdb
.
t0
;
DROP
TABLE
IF
EXISTS
federated
.
t0
;
--
enable_warnings
--
echo
#
--
echo
# Create the base table to be referenced
--
echo
#
CREATE
TABLE
realdb
.
t0
(
a
text
,
b
text
)
ENGINE
=
MYISAM
;
--
echo
#
--
echo
# Create a federated table with a bogus port number
--
echo
#
CREATE
TABLE
federated
.
t0
(
a
text
,
b
text
)
ENGINE
=
FEDERATED
CONNECTION
=
'mysql://root@127.0.0.1:63333/realdb/t0'
;
#--warning ER_CONNECT_TO_FOREIGN_DATA_SOURCE
--
echo
#
--
echo
# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query
--
echo
#
# Remove O/S-specific socket error
--
replace_regex
/
\
(
.*
\
)
/
(
socket
errno
)
/
SELECT
TABLE_SCHEMA
,
TABLE_NAME
,
TABLE_TYPE
,
ENGINE
,
ROW_FORMAT
,
TABLE_ROWS
,
DATA_LENGTH
,
TABLE_COMMENT
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
'realdb'
or
TABLE_SCHEMA
=
'federated'
;
# Remove O/S-specific socket error
--
replace_regex
/
\
(
.*
\
)
/
(
socket
errno
)
/
SHOW
WARNINGS
;
--
echo
#
--
echo
# Create a MyISAM table then corrupt the file
--
echo
#
USE
realdb
;
CREATE
TABLE
t1
(
c1
int
)
ENGINE
=
MYISAM
;
--
echo
#
--
echo
# Corrupt the MyISAM table by deleting the base file
--
echo
#
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
--
remove_file
$MYSQLD_DATADIR
/
realdb
/
t1
.
MYD
--
remove_file
$MYSQLD_DATADIR
/
realdb
/
t1
.
MYI
--
echo
#
--
echo
# Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query
--
echo
#
SELECT
TABLE_SCHEMA
,
TABLE_NAME
,
TABLE_TYPE
,
ENGINE
,
ROW_FORMAT
,
TABLE_ROWS
,
DATA_LENGTH
,
TABLE_COMMENT
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_NAME
=
't1'
;
SHOW
WARNINGS
;
--
echo
#
--
echo
# Cleanup
--
echo
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
realdb
.
t0
;
DROP
TABLE
IF
EXISTS
federated
.
t0
;
DROP
DATABASE
realdb
;
--
enable_warnings
--
source
include
/
federated_cleanup
.
inc
mysql-test/t/func_gconcat.test
View file @
89d01ca0
...
@@ -708,4 +708,18 @@ SELECT 1 FROM
...
@@ -708,4 +708,18 @@ SELECT 1 FROM
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #54476: crash when group_concat and 'with rollup' in prepared statements
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
PREPARE
stmt
FROM
"SELECT GROUP_CONCAT(t1.a ORDER BY t1.a) FROM t1 JOIN t1 t2 GROUP BY t1.a WITH ROLLUP"
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/item_sum.cc
View file @
89d01ca0
...
@@ -3170,7 +3170,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
...
@@ -3170,7 +3170,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
tree
(
item
->
tree
),
tree
(
item
->
tree
),
unique_filter
(
item
->
unique_filter
),
unique_filter
(
item
->
unique_filter
),
table
(
item
->
table
),
table
(
item
->
table
),
order
(
item
->
order
),
context
(
item
->
context
),
context
(
item
->
context
),
arg_count_order
(
item
->
arg_count_order
),
arg_count_order
(
item
->
arg_count_order
),
arg_count_field
(
item
->
arg_count_field
),
arg_count_field
(
item
->
arg_count_field
),
...
@@ -3183,6 +3182,24 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
...
@@ -3183,6 +3182,24 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
{
{
quick_group
=
item
->
quick_group
;
quick_group
=
item
->
quick_group
;
result
.
set_charset
(
collation
.
collation
);
result
.
set_charset
(
collation
.
collation
);
/*
Since the ORDER structures pointed to by the elements of the 'order' array
may be modified in find_order_in_list() called from
Item_func_group_concat::setup(), create a copy of those structures so that
such modifications done in this object would not have any effect on the
object being copied.
*/
ORDER
*
tmp
;
if
(
!
(
order
=
(
ORDER
**
)
thd
->
alloc
(
sizeof
(
ORDER
*
)
*
arg_count_order
+
sizeof
(
ORDER
)
*
arg_count_order
)))
return
;
tmp
=
(
ORDER
*
)(
order
+
arg_count_order
);
for
(
uint
i
=
0
;
i
<
arg_count_order
;
i
++
,
tmp
++
)
{
memcpy
(
tmp
,
item
->
order
[
i
],
sizeof
(
ORDER
));
order
[
i
]
=
tmp
;
}
}
}
...
...
sql/sql_show.cc
View file @
89d01ca0
This diff is collapsed.
Click to expand it.
sql/table.h
View file @
89d01ca0
...
@@ -31,7 +31,6 @@ typedef struct st_order {
...
@@ -31,7 +31,6 @@ typedef struct st_order {
struct
st_order
*
next
;
struct
st_order
*
next
;
Item
**
item
;
/* Point at item in select fields */
Item
**
item
;
/* Point at item in select fields */
Item
*
item_ptr
;
/* Storage for initial item */
Item
*
item_ptr
;
/* Storage for initial item */
Item
**
item_copy
;
/* For SPs; the original item ptr */
int
counter
;
/* position in SELECT list, correct
int
counter
;
/* position in SELECT list, correct
only if counter_used is true*/
only if counter_used is true*/
bool
asc
;
/* true if ascending */
bool
asc
;
/* true if ascending */
...
...
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