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
a7da1a1a
Commit
a7da1a1a
authored
Aug 11, 2011
by
Tatjana Azundris Nuernberg
Browse files
Options
Browse Files
Download
Plain Diff
auto-merge
parents
5962cadc
00dad1c0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
4 deletions
+93
-4
mysql-test/r/sp_trans.result
mysql-test/r/sp_trans.result
+46
-0
mysql-test/t/sp_trans.test
mysql-test/t/sp_trans.test
+33
-0
sql/sql_parse.cc
sql/sql_parse.cc
+6
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+8
-4
No files found.
mysql-test/r/sp_trans.result
View file @
a7da1a1a
...
@@ -558,6 +558,52 @@ f1 bug13575(f1)
...
@@ -558,6 +558,52 @@ f1 bug13575(f1)
3 ccc
3 ccc
drop function bug13575|
drop function bug13575|
drop table t3|
drop table t3|
SELECT @@GLOBAL.storage_engine INTO @old_engine|
SET @@GLOBAL.storage_engine=InnoDB|
SET @@SESSION.storage_engine=InnoDB|
SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine InnoDB
SHOW SESSION VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine InnoDB
CREATE PROCEDURE bug11758414()
BEGIN
SET @@GLOBAL.storage_engine="MyISAM";
SET @@SESSION.storage_engine="MyISAM";
# show defaults at execution time / that setting them worked
SHOW GLOBAL VARIABLES LIKE 'storage_engine';
SHOW SESSION VARIABLES LIKE 'storage_engine';
CREATE TABLE t1 (id int);
CREATE TABLE t2 (id int) ENGINE=InnoDB;
# show we're heeding the default (at run-time, not parse-time!)
SHOW CREATE TABLE t1;
# show that we didn't break explicit override with ENGINE=...
SHOW CREATE TABLE t2;
END;
|
CALL bug11758414|
Variable_name Value
storage_engine MyISAM
Variable_name Value
storage_engine MyISAM
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine MyISAM
SHOW SESSION VARIABLES LIKE 'storage_engine'|
Variable_name Value
storage_engine MyISAM
DROP PROCEDURE bug11758414|
DROP TABLE t1, t2|
SET @@GLOBAL.storage_engine=@old_engine|
#
#
# End of 5.1 tests
# End of 5.1 tests
#
#
...
...
mysql-test/t/sp_trans.test
View file @
a7da1a1a
...
@@ -598,6 +598,39 @@ select distinct f1, bug13575(f1) from t3 order by f1|
...
@@ -598,6 +598,39 @@ select distinct f1, bug13575(f1) from t3 order by f1|
drop
function
bug13575
|
drop
function
bug13575
|
drop
table
t3
|
drop
table
t3
|
#
# BUG#11758414: Default storage_engine not honored when set
# from within a stored procedure
#
SELECT
@@
GLOBAL
.
storage_engine
INTO
@
old_engine
|
SET
@@
GLOBAL
.
storage_engine
=
InnoDB
|
SET
@@
SESSION
.
storage_engine
=
InnoDB
|
# show defaults at define-time
SHOW
GLOBAL
VARIABLES
LIKE
'storage_engine'
|
SHOW
SESSION
VARIABLES
LIKE
'storage_engine'
|
CREATE
PROCEDURE
bug11758414
()
BEGIN
SET
@@
GLOBAL
.
storage_engine
=
"MyISAM"
;
SET
@@
SESSION
.
storage_engine
=
"MyISAM"
;
# show defaults at execution time / that setting them worked
SHOW
GLOBAL
VARIABLES
LIKE
'storage_engine'
;
SHOW
SESSION
VARIABLES
LIKE
'storage_engine'
;
CREATE
TABLE
t1
(
id
int
);
CREATE
TABLE
t2
(
id
int
)
ENGINE
=
InnoDB
;
# show we're heeding the default (at run-time, not parse-time!)
SHOW
CREATE
TABLE
t1
;
# show that we didn't break explicit override with ENGINE=...
SHOW
CREATE
TABLE
t2
;
END
;
|
CALL
bug11758414
|
# show that changing defaults within SP stuck
SHOW
GLOBAL
VARIABLES
LIKE
'storage_engine'
|
SHOW
SESSION
VARIABLES
LIKE
'storage_engine'
|
DROP
PROCEDURE
bug11758414
|
DROP
TABLE
t1
,
t2
|
SET
@@
GLOBAL
.
storage_engine
=@
old_engine
|
--
echo
#
--
echo
#
--
echo
# End of 5.1 tests
--
echo
# End of 5.1 tests
--
echo
#
--
echo
#
...
...
sql/sql_parse.cc
View file @
a7da1a1a
...
@@ -2347,6 +2347,12 @@ case SQLCOM_PREPARE:
...
@@ -2347,6 +2347,12 @@ case SQLCOM_PREPARE:
create_table
->
table_name
))
create_table
->
table_name
))
goto
end_with_restore_list
;
goto
end_with_restore_list
;
#endif
#endif
/*
If no engine type was given, work out the default now
rather than at parse-time.
*/
if
(
!
(
create_info
.
used_fields
&
HA_CREATE_USED_ENGINE
))
create_info
.
db_type
=
ha_default_handlerton
(
thd
);
/*
/*
If we are using SET CHARSET without DEFAULT, add an implicit
If we are using SET CHARSET without DEFAULT, add an implicit
DEFAULT to not confuse old users. (This may change).
DEFAULT to not confuse old users. (This may change).
...
...
sql/sql_yacc.yy
View file @
a7da1a1a
...
@@ -2038,7 +2038,6 @@ create:
...
@@ -2038,7 +2038,6 @@ create:
lex->change=NullS;
lex->change=NullS;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
bzero((char*) &lex->create_info,sizeof(lex->create_info));
lex->create_info.options=$2 | $4;
lex->create_info.options=$2 | $4;
lex->create_info.db_type= ha_default_handlerton(thd);
lex->create_info.default_table_charset= NULL;
lex->create_info.default_table_charset= NULL;
lex->name.str= 0;
lex->name.str= 0;
lex->name.length= 0;
lex->name.length= 0;
...
@@ -2048,7 +2047,8 @@ create:
...
@@ -2048,7 +2047,8 @@ create:
{
{
LEX *lex= YYTHD->lex;
LEX *lex= YYTHD->lex;
lex->current_select= &lex->select_lex;
lex->current_select= &lex->select_lex;
if (!lex->create_info.db_type)
if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
!lex->create_info.db_type)
{
{
lex->create_info.db_type= ha_default_handlerton(YYTHD);
lex->create_info.db_type= ha_default_handlerton(YYTHD);
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
...
@@ -5036,7 +5036,6 @@ create_table_option:
...
@@ -5036,7 +5036,6 @@ create_table_option:
ENGINE_SYM opt_equal storage_engines
ENGINE_SYM opt_equal storage_engines
{
{
Lex->create_info.db_type= $3;
Lex->create_info.db_type= $3;
if ($3)
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
}
}
| MAX_ROWS opt_equal ulonglong_num
| MAX_ROWS opt_equal ulonglong_num
...
@@ -6748,6 +6747,11 @@ alter_list_item:
...
@@ -6748,6 +6747,11 @@ alter_list_item:
{
{
LEX *lex=Lex;
LEX *lex=Lex;
lex->alter_info.flags|= ALTER_OPTIONS;
lex->alter_info.flags|= ALTER_OPTIONS;
if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
!lex->create_info.db_type)
{
lex->create_info.used_fields&= ~HA_CREATE_USED_ENGINE;
}
}
}
| FORCE_SYM
| FORCE_SYM
{
{
...
...
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