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
a0ab3d0d
Commit
a0ab3d0d
authored
Feb 28, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Regression test for #1134338 and #1134337 and #1134265
parent
ce46146b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
1 deletion
+93
-1
sql/table.cc
sql/table.cc
+12
-1
storage/oqgraph/regressiontest.sql.in
storage/oqgraph/regressiontest.sql.in
+81
-0
No files found.
sql/table.cc
View file @
a0ab3d0d
...
...
@@ -380,7 +380,18 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
DBUG_ENTER
(
"init_tmp_table_share"
);
DBUG_PRINT
(
"enter"
,
(
"table: '%s'.'%s'"
,
key
,
table_name
));
bzero
((
char
*
)
share
,
sizeof
(
*
share
));
/*
Dont let badly coded plugins crash the daemon here...
The table_name and path cannot be NULL.
ASSERT if debug enabled, otherwise, just warn and return.
*/
DBUG_ASSERT
(
table_name
);
DBUG_ASSERT
(
path
);
if
(
table_name
==
NULL
||
path
==
NULL
)
{
sql_print_warning
(
"Someone called init_tmp_table_share() with invalid table_name or path."
);
return
;
}
bzero
((
char
*
)
share
,
sizeof
(
*
share
));
/*
This can't be MY_THREAD_SPECIFIC for slaves as they are freed
during cleanup() from Relay_log_info::close_temporary_tables()
...
...
storage/oqgraph/regressiontest.sql.in
0 → 100644
View file @
a0ab3d0d
/* How to run me: using the C preprocessor:
* cpp -P regressiontest.sql.in |client/mysql --skip-pager --force --silent test
*
* Expected result:
* 1. No mysqld crash
* 2. Error -1
* 3. Successful DESCRIBEs where noted
*/
#define Create_OQ_TABLE(name) \
CREATE TABLE name ( \
latch SMALLINT UNSIGNED NULL, \
origid BIGINT UNSIGNED NULL, \
destid BIGINT UNSIGNED NULL, \
weight DOUBLE NULL, \
seq BIGINT UNSIGNED NULL, \
linkid BIGINT UNSIGNED NULL, \
KEY (latch, origid, destid) USING HASH, \
KEY (latch, destid, origid) USING HASH \
) ENGINE=OQGRAPH
#define Drop(name) DROP TABLE IF EXISTS `name`
#define P1(x) #x
#define P2(x) P1(x)
#define EXPECT_ERROR_1 select P2(__LINE__) , 'Expect error -1:'
#define EXPECT_SUCCESS(x) select P2(__LINE__) , 'Expect ' x ':'
/* status*/
warnings
Drop(not_backing);
Drop(backing);
Drop(oqtable);
CREATE TABLE `not_backing` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`info` varchar(20) DEFAULT NULL,
KEY `name` (`info`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `backing` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`parent` int(10) unsigned DEFAULT NULL,
`weight` real(10,4) NOT NULL DEFAULT 0.0,
`info` varchar(20) DEFAULT NULL,
`not_id_type` varchar(20) DEFAULT NULL,
`not_weight_type` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `name` (`info`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/* Attempt to create with no attributes. Fail expcted. */
select __LINE__ ; Create_OQ_TABLE( oqtable); describe oqtable;
/* Attempt to create with various attributes missing, but at least one present */
/* Create will succeed, and then cause describe to fail */
select 'Attributes test...';
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE=''; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='bogus'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='not_backing'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing'; describe oqtable;
/* attributes are processed insid ha_oqgraph::open left to right. So if dont put data_table in the following they all look the same as data_table=''*/
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID=''; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='bogus'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='not_id_type'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID=''; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID='bogus'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID='not_id_type'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='bogus',DESTID='id'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='not_id_type',DESTID='id'; describe oqtable;
EXPECT_SUCCESS('successful DESCRIBE'); Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID='id'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID='id',WEIGHT='bogus'; describe oqtable;
EXPECT_ERROR_1; Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID='id',WEIGHT='not_weight_type'; describe oqtable;
EXPECT_SUCCESS('successful DESCRIBE'); Drop(oqtable); Create_OQ_TABLE( oqtable), DATA_TABLE='backing',ORIGID='id',DESTID='id',WEIGHT='weight'; describe oqtable;
Drop(oqtable);
/* As at Feb 28, DATA_TABLE='x' does not check if x exists or is wrong structure, on hq_oqgraph::open (describe)
/* show tables; */
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