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
66774f41
Commit
66774f41
authored
Oct 16, 2009
by
Konstantin Osipov
Browse files
Options
Browse Files
Download
Plain Diff
Merge with next-mr-runtime
parents
88f7de57
eed8c7ab
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
182 additions
and
61 deletions
+182
-61
Makefile.am
Makefile.am
+2
-1
mysql-test/r/create.result
mysql-test/r/create.result
+34
-0
mysql-test/r/log_state.result
mysql-test/r/log_state.result
+24
-0
mysql-test/t/create.test
mysql-test/t/create.test
+53
-0
mysql-test/t/log_state.test
mysql-test/t/log_state.test
+34
-58
sql/ha_partition.cc
sql/ha_partition.cc
+17
-0
sql/ha_partition.h
sql/ha_partition.h
+1
-0
sql/set_var.cc
sql/set_var.cc
+13
-2
sql/sql_insert.cc
sql/sql_insert.cc
+1
-0
sql/table.cc
sql/table.cc
+2
-0
sql/table.h
sql/table.h
+1
-0
No files found.
Makefile.am
View file @
66774f41
...
...
@@ -98,7 +98,8 @@ test-pr:
test-ns
:
cd
mysql-test
;
\
@PERL@ ./mysql-test-run.pl
$(force)
$(mem)
--mysqld
=
--binlog-format
=
mixed
@PERL@ ./mysql-test-run.pl
$(force)
$(mem)
--mysqld
=
--binlog-format
=
mixed
;
\
@PERL@ ./mysql-test-run.pl
$(force)
$(mem)
--suite
=
funcs_1
test-binlog-statement
:
cd
mysql-test
;
\
...
...
mysql-test/r/create.result
View file @
66774f41
...
...
@@ -1922,3 +1922,37 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
# -- End of Bug#45829
End of 5.1 tests
# --
# -- Bug #43054 Assertion `!table->auto_increment_field_not_null'
# -- failed when redefining trigger
CREATE TABLE B (
pk INTEGER AUTO_INCREMENT,
int_key INTEGER NOT NULL,
PRIMARY KEY (pk),
KEY (int_key)
);
INSERT IGNORE INTO B VALUES ('9', '9');
CREATE TABLE IF NOT EXISTS t1 (
`pk` INTEGER NOT NULL AUTO_INCREMENT ,
`int` INTEGER ,
PRIMARY KEY ( `pk` )
) SELECT `pk` , `int_key` FROM B ;
CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
BEGIN
INSERT INTO t1 ( `int` ) VALUES (4 ),( 8 ),( 2 ) ;
END ; |
CREATE TABLE IF NOT EXISTS t1 (
`pk` INTEGER NOT NULL AUTO_INCREMENT ,
`int` INTEGER ,
PRIMARY KEY ( `pk` )
) SELECT `pk` , `int_key` FROM B ;
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
BEGIN
UPDATE A SET `pk`=1 WHERE `pk`=0 ;
END ;|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
DROP TABLE t1;
DROP TABLE B;
mysql-test/r/log_state.result
View file @
66774f41
...
...
@@ -309,6 +309,30 @@ SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
End of 5.1 tests
# --
# -- Bug#38124: "general_log_file" variable silently unset when
# -- using expression
# --
SET GLOBAL general_log_file = DEFAULT;
SELECT @@general_log_file INTO @my_glf;
SET GLOBAL general_log_file = 'BUG38124.LOG';
SELECT @@general_log_file;
@@general_log_file
BUG38124.LOG
SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
SELECT @@general_log_file;
@@general_log_file
BUG38124-2.LOG
SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
SELECT @@general_log_file;
@@general_log_file
G38124
SET GLOBAL general_log_file = DEFAULT;
SELECT @@general_log_file = @my_glf;
@@general_log_file = @my_glf
1
SET GLOBAL general_log_file = @old_general_log_file;
# Close connection con1
SET global general_log = @old_general_log;
SET global general_log_file = @old_general_log_file;
...
...
mysql-test/t/create.test
View file @
66774f41
...
...
@@ -1582,3 +1582,56 @@ create table t3 (a int) row_format=page;
--
echo
--
echo
End
of
5.1
tests
###########################################################################
--
echo
--
echo
# --
--
echo
# -- Bug #43054 Assertion `!table->auto_increment_field_not_null'
--
echo
# -- failed when redefining trigger
--
echo
#--disable_abort_on_error
CREATE
TABLE
B
(
pk
INTEGER
AUTO_INCREMENT
,
int_key
INTEGER
NOT
NULL
,
PRIMARY
KEY
(
pk
),
KEY
(
int_key
)
);
INSERT
IGNORE
INTO
B
VALUES
(
'9'
,
'9'
);
CREATE
TABLE
IF
NOT
EXISTS
t1
(
`pk`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`int`
INTEGER
,
PRIMARY
KEY
(
`pk`
)
)
SELECT
`pk`
,
`int_key`
FROM
B
;
--
delimiter
|
CREATE
TRIGGER
f
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
BEGIN
INSERT
INTO
t1
(
`int`
)
VALUES
(
4
),(
8
),(
2
)
;
END
;
|
--
delimiter
;
--
error
ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
CREATE
TABLE
IF
NOT
EXISTS
t1
(
`pk`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`int`
INTEGER
,
PRIMARY
KEY
(
`pk`
)
)
SELECT
`pk`
,
`int_key`
FROM
B
;
--
delimiter
|
--
error
ER_NOT_SUPPORTED_YET
CREATE
TRIGGER
f
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
BEGIN
UPDATE
A
SET
`pk`
=
1
WHERE
`pk`
=
0
;
END
;
|
--
delimiter
;
DROP
TABLE
t1
;
DROP
TABLE
B
;
mysql-test/t/log_state.test
View file @
66774f41
### t/log_state.test ###
#
# This test suffers from server
# Bug#38124 "general_log_file" variable silently unset when using expression
# In short:
# SET GLOBAL general_log_file = @<whatever>
# SET GLOBAL slow_query_log = @<whatever>
# cause that the value of these server system variables is set to default
# instead of the assigned values. There comes no error message or warning.
# If this bug is fixed please
# 1. try this test with "let $fixed_bug38124 = 0;"
# 2. remove all workarounds if 1. was successful.
let
$fixed_bug38124
=
0
;
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_csv
.
inc
...
...
@@ -166,16 +155,6 @@ SET @@global.general_log = @old_general_log;
SET
@@
global
.
general_log_file
=
@
old_general_log_file
;
SET
@@
global
.
slow_query_log
=
@
old_slow_query_log
;
SET
@@
global
.
slow_query_log_file
=
@
old_slow_query_log_file
;
if
(
!
$fixed_bug38124
)
{
--
disable_query_log
let
$my_var
=
`SELECT @old_general_log_file`
;
eval
SET
@@
global
.
general_log_file
=
'$my_var'
;
let
$my_var
=
`SELECT @old_slow_query_log_file`
;
eval
SET
@@
global
.
slow_query_log_file
=
'$my_var'
;
--
enable_query_log
}
###########################################################################
...
...
@@ -278,15 +257,6 @@ SET GLOBAL slow_query_log_file= NULL;
# Reset to initial values in case a setting above was successful.
SET
GLOBAL
general_log_file
=
@
old_general_log_file
;
SET
GLOBAL
slow_query_log_file
=
@
old_slow_query_log_file
;
if
(
!
$fixed_bug38124
)
{
--
disable_query_log
let
$my_var
=
`SELECT @old_general_log_file`
;
eval
SET
@@
global
.
general_log_file
=
'$my_var'
;
let
$my_var
=
`SELECT @old_slow_query_log_file`
;
eval
SET
@@
global
.
slow_query_log_file
=
'$my_var'
;
--
enable_query_log
}
###########################################################################
...
...
@@ -307,15 +277,6 @@ SHOW VARIABLES LIKE '%log_file';
--
echo
SET
GLOBAL
general_log_file
=
@
old_general_log_file
;
SET
GLOBAL
slow_query_log_file
=
@
old_slow_query_log_file
;
if
(
!
$fixed_bug38124
)
{
--
disable_query_log
let
$my_var
=
`SELECT @old_general_log_file`
;
eval
SET
@@
global
.
general_log_file
=
'$my_var'
;
let
$my_var
=
`SELECT @old_slow_query_log_file`
;
eval
SET
@@
global
.
slow_query_log_file
=
'$my_var'
;
--
enable_query_log
}
--
echo
--
echo
# -- End of Bug#32748.
...
...
@@ -351,19 +312,43 @@ SET @@global.general_log = @old_general_log;
SET
@@
global
.
general_log_file
=
@
old_general_log_file
;
SET
@@
global
.
slow_query_log
=
@
old_slow_query_log
;
SET
@@
global
.
slow_query_log_file
=
@
old_slow_query_log_file
;
if
(
!
$fixed_bug38124
)
{
--
disable_query_log
let
$my_var
=
`SELECT @old_general_log_file`
;
eval
SET
@@
global
.
general_log_file
=
'$my_var'
;
let
$my_var
=
`SELECT @old_slow_query_log_file`
;
eval
SET
@@
global
.
slow_query_log_file
=
'$my_var'
;
--
enable_query_log
}
--
echo
End
of
5.1
tests
###########################################################################
--
echo
--
echo
# --
--
echo
# -- Bug#38124: "general_log_file" variable silently unset when
--
echo
# -- using expression
--
echo
# --
# Store away the special DEFAULT value so we
# can compare it later, then try to set the
# general_log_file using different functions
# and expressions.
SET
GLOBAL
general_log_file
=
DEFAULT
;
SELECT
@@
general_log_file
INTO
@
my_glf
;
SET
GLOBAL
general_log_file
=
'BUG38124.LOG'
;
SELECT
@@
general_log_file
;
SET
GLOBAL
general_log_file
=
concat
(
'BUG38124-2.LOG'
);
SELECT
@@
general_log_file
;
SET
GLOBAL
general_log_file
=
substr
(
'BUG38124-2.LOG'
,
3
,
6
);
SELECT
@@
general_log_file
;
SET
GLOBAL
general_log_file
=
DEFAULT
;
SELECT
@@
general_log_file
=
@
my_glf
;
## Reset to initial values
SET
GLOBAL
general_log_file
=
@
old_general_log_file
;
--
enable_ps_protocol
#
...
...
@@ -380,15 +365,6 @@ SET global general_log = @old_general_log;
SET
global
general_log_file
=
@
old_general_log_file
;
SET
global
slow_query_log
=
@
old_slow_query_log
;
SET
global
slow_query_log_file
=
@
old_slow_query_log_file
;
if
(
!
$fixed_bug38124
)
{
--
disable_query_log
let
$my_var
=
`SELECT @old_general_log_file`
;
eval
SET
@@
global
.
general_log_file
=
'$my_var'
;
let
$my_var
=
`SELECT @old_slow_query_log_file`
;
eval
SET
@@
global
.
slow_query_log_file
=
'$my_var'
;
--
enable_query_log
}
# Remove the log file that was created in the "default location"
# i.e var/run
...
...
sql/ha_partition.cc
View file @
66774f41
...
...
@@ -2452,6 +2452,21 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
/****************************************************************************
MODULE open/close object
****************************************************************************/
/**
A destructor for partition-specific TABLE_SHARE data.
*/
void
ha_data_partition_destroy
(
void
*
ha_data
)
{
if
(
ha_data
)
{
HA_DATA_PARTITION
*
ha_data_partition
=
(
HA_DATA_PARTITION
*
)
ha_data
;
pthread_mutex_destroy
(
&
ha_data_partition
->
mutex
);
}
}
/*
Open handler object
...
...
@@ -2608,6 +2623,8 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
}
DBUG_PRINT
(
"info"
,
(
"table_share->ha_data 0x%p"
,
ha_data
));
bzero
(
ha_data
,
sizeof
(
HA_DATA_PARTITION
));
table_share
->
ha_data_destroy
=
ha_data_partition_destroy
;
pthread_mutex_init
(
&
ha_data
->
mutex
,
MY_MUTEX_INIT_FAST
);
}
if
(
is_not_tmp_table
)
pthread_mutex_unlock
(
&
table_share
->
mutex
);
...
...
sql/ha_partition.h
View file @
66774f41
...
...
@@ -45,6 +45,7 @@ typedef struct st_ha_data_partition
{
ulonglong
next_auto_inc_val
;
/**< first non reserved value */
bool
auto_inc_initialized
;
pthread_mutex_t
mutex
;
}
HA_DATA_PARTITION
;
#define PARTITION_BYTES_IN_POS 2
...
...
sql/set_var.cc
View file @
66774f41
...
...
@@ -2535,9 +2535,20 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
{
MYSQL_QUERY_LOG
*
file_log
;
char
buff
[
FN_REFLEN
];
char
*
res
=
0
,
*
old_value
=
(
char
*
)(
var
?
var
->
value
->
str_value
.
ptr
()
:
0
)
;
char
*
res
=
0
,
*
old_value
=
0
;
bool
result
=
0
;
uint
str_length
=
(
var
?
var
->
value
->
str_value
.
length
()
:
0
);
uint
str_length
=
0
;
if
(
var
)
{
String
str
(
buff
,
sizeof
(
buff
),
system_charset_info
),
*
newval
;
newval
=
var
->
value
->
val_str
(
&
str
);
old_value
=
newval
->
c_ptr_safe
();
str_length
=
strlen
(
old_value
);
}
switch
(
log_type
)
{
case
QUERY_LOG_SLOW
:
...
...
sql/sql_insert.cc
View file @
66774f41
...
...
@@ -3843,6 +3843,7 @@ void select_create::abort()
{
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
table
->
file
->
extra
(
HA_EXTRA_WRITE_CANNOT_REPLACE
);
table
->
auto_increment_field_not_null
=
FALSE
;
if
(
!
create_info
->
table_existed
)
drop_open_table
(
thd
,
table
,
create_table
->
db
,
create_table
->
table_name
);
table
=
0
;
// Safety
...
...
sql/table.cc
View file @
66774f41
...
...
@@ -1601,6 +1601,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
delete
crypted
;
delete
handler_file
;
my_hash_free
(
&
share
->
name_hash
);
if
(
share
->
ha_data_destroy
)
share
->
ha_data_destroy
(
share
->
ha_data
);
open_table_error
(
share
,
error
,
share
->
open_errno
,
errarg
);
DBUG_RETURN
(
error
);
...
...
sql/table.h
View file @
66774f41
...
...
@@ -419,6 +419,7 @@ struct TABLE_SHARE
/** place to store storage engine specific data */
void
*
ha_data
;
void
(
*
ha_data_destroy
)(
void
*
);
/* An optional destructor for ha_data */
/*
...
...
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