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
690a117d
Commit
690a117d
authored
Jun 26, 2009
by
Staale Smedseng
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 5.1-bugteam
parents
6afd14e5
3c117ca3
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
235 additions
and
14 deletions
+235
-14
mysql-test/extra/rpl_tests/rpl_reset_slave.test
mysql-test/extra/rpl_tests/rpl_reset_slave.test
+54
-0
mysql-test/r/ctype_cp932_binlog_stm.result
mysql-test/r/ctype_cp932_binlog_stm.result
+8
-8
mysql-test/r/ctype_gbk_binlog.result
mysql-test/r/ctype_gbk_binlog.result
+26
-0
mysql-test/r/trigger_notembedded.result
mysql-test/r/trigger_notembedded.result
+14
-0
mysql-test/suite/rpl/r/rpl_row_reset_slave.result
mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+23
-0
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+23
-0
mysql-test/t/ctype_cp932_binlog_stm.test
mysql-test/t/ctype_cp932_binlog_stm.test
+3
-2
mysql-test/t/ctype_gbk_binlog.test
mysql-test/t/ctype_gbk_binlog.test
+36
-0
mysql-test/t/trigger_notembedded.test
mysql-test/t/trigger_notembedded.test
+23
-0
mysys/my_getopt.c
mysys/my_getopt.c
+13
-2
sql/item.cc
sql/item.cc
+2
-2
sql/slave.cc
sql/slave.cc
+3
-0
sql/sql_repl.cc
sql/sql_repl.cc
+1
-0
sql/sql_show.cc
sql/sql_show.cc
+6
-0
No files found.
mysql-test/extra/rpl_tests/rpl_reset_slave.test
View file @
690a117d
...
...
@@ -41,3 +41,57 @@ reset slave;
start
slave
;
sync_with_master
;
show
status
like
'slave_open_temp_tables'
;
#
#Bug#34654 RESET SLAVE does not clear LAST_IO_Err*
#
# clearing the status
stop
slave
;
reset
slave
;
let
$last_io_errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Errno
,
1
);
echo
***
errno
must
be
zero
:
$last_io_errno
***
;
#
# verifying start slave resets Last_IO_Error and Last_IO_Errno.
#
change
master
to
master_user
=
'impossible_user_name'
;
start
slave
;
source
include
/
wait_for_slave_io_to_stop
.
inc
;
let
$last_io_errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Errno
,
1
);
--
disable_query_log
eval
SELECT
$last_io_errno
>
0
as
ONE
;
--
enable_query_log
source
include
/
stop_slave
.
inc
;
change
master
to
master_user
=
'root'
;
source
include
/
start_slave
.
inc
;
let
$last_io_errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Errno
,
1
);
let
$last_io_error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Error
,
1
);
--
echo
***
last
errno
must
be
zero
:
$last_io_errno
***
--
echo
***
last
error
must
be
blank
:
$last_io_error
***
#
# verifying reset slave resets Last_{IO,SQL}_Err{or,no}
#
source
include
/
stop_slave
.
inc
;
change
master
to
master_user
=
'impossible_user_name'
;
start
slave
;
source
include
/
wait_for_slave_io_to_stop
.
inc
;
let
$last_io_errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Errno
,
1
);
--
disable_query_log
eval
SELECT
$last_io_errno
>
0
as
ONE
;
--
enable_query_log
source
include
/
stop_slave
.
inc
;
reset
slave
;
let
$last_io_errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Errno
,
1
);
let
$last_io_error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_IO_Error
,
1
);
let
$last_sql_errno
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Errno
,
1
);
let
$last_sql_error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_SQL_Error
,
1
);
--
echo
***
io
last
errno
must
be
zero
:
$last_io_errno
***
--
echo
***
io
last
error
must
be
blank
:
$last_io_error
***
--
echo
***
sql
last
errno
must
be
zero
:
$last_sql_errno
***
--
echo
***
sql
last
error
must
be
blank
:
$last_sql_error
***
mysql-test/r/ctype_cp932_binlog_stm.result
View file @
690a117d
...
...
@@ -9,7 +9,7 @@ EXECUTE stmt1 USING @var1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(
'\0')
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(
0x8300
)
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
...
...
@@ -29,22 +29,22 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
SHOW BINLOG EVENTS FROM 3
69
|
SHOW BINLOG EVENTS FROM 3
70
|
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 3
69 Query 1 535
use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
master-bin.000001 3
70 Query 1 536
use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
master-bin.000001 53
5 Query 1 784
use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
master-bin.000001 53
6 Query 1 785
use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
master-bin.000001 78
4 Query 1 1048
use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
master-bin.000001 104
8 Query 1 1137
use `test`; DROP PROCEDURE bug18293
master-bin.000001 113
7 Query 1 1216
use `test`; DROP TABLE t4
master-bin.000001 78
5 Query 1 1049
use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
master-bin.000001 104
9 Query 1 1138
use `test`; DROP PROCEDURE bug18293
master-bin.000001 113
8 Query 1 1217
use `test`; DROP TABLE t4
End of 5.0 tests
SHOW BINLOG EVENTS FROM 36
4
;
SHOW BINLOG EVENTS FROM 36
5
;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932;
...
...
mysql-test/r/ctype_gbk_binlog.result
0 → 100644
View file @
690a117d
SET NAMES gbk;
CREATE TABLE t1 (
f1 BLOB
) ENGINE=MyISAM DEFAULT CHARSET=gbk;
CREATE PROCEDURE p1(IN val BLOB)
BEGIN
SET @tval = val;
SET @sql_cmd = CONCAT_WS(' ', 'insert into t1(f1) values(?)');
PREPARE stmt FROM @sql_cmd;
EXECUTE stmt USING @tval;
DEALLOCATE PREPARE stmt;
END|
SET @`tcontent`:=_binary 0x50434B000900000000000000E9000000 COLLATE `binary`/*!*/;
CALL p1(@`tcontent`);
FLUSH LOGS;
DROP PROCEDURE p1;
RENAME TABLE t1 to t2;
SELECT hex(f1) FROM t2;
hex(f1)
50434B000900000000000000E9000000
SELECT hex(f1) FROM t1;
hex(f1)
50434B000900000000000000E9000000
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE t2;
mysql-test/r/trigger_notembedded.result
View file @
690a117d
...
...
@@ -462,4 +462,18 @@ unlock tables;
select * from t1;
i
drop table t1;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a char(30)) ENGINE=MEMORY;
CREATE TRIGGER db1.trg AFTER INSERT ON db1.t1 FOR EACH ROW
INSERT INTO db1.t1 VALUES('Some very sensitive data goes here');
CREATE USER 'no_rights'@'localhost';
REVOKE ALL ON *.* FROM 'no_rights'@'localhost';
FLUSH PRIVILEGES;
SELECT trigger_name FROM INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_schema = 'db1';
trigger_name
SHOW CREATE TRIGGER db1.trg;
ERROR 42000: Access denied; you need the TRIGGER privilege for this operation
DROP USER 'no_rights'@'localhost';
DROP DATABASE db1;
End of 5.1 tests.
mysql-test/suite/rpl/r/rpl_row_reset_slave.result
View file @
690a117d
...
...
@@ -174,3 +174,26 @@ start slave;
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
stop slave;
reset slave;
*** errno must be zero: 0 ***
change master to master_user='impossible_user_name';
start slave;
ONE
1
include/stop_slave.inc
change master to master_user='root';
include/start_slave.inc
*** last errno must be zero: 0 ***
*** last error must be blank: ***
include/stop_slave.inc
change master to master_user='impossible_user_name';
start slave;
ONE
1
include/stop_slave.inc
reset slave;
*** io last errno must be zero: 0 ***
*** io last error must be blank: ***
*** sql last errno must be zero: 0 ***
*** sql last error must be blank: ***
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
View file @
690a117d
...
...
@@ -174,3 +174,26 @@ start slave;
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
stop slave;
reset slave;
*** errno must be zero: 0 ***
change master to master_user='impossible_user_name';
start slave;
ONE
1
include/stop_slave.inc
change master to master_user='root';
include/start_slave.inc
*** last errno must be zero: 0 ***
*** last error must be blank: ***
include/stop_slave.inc
change master to master_user='impossible_user_name';
start slave;
ONE
1
include/stop_slave.inc
reset slave;
*** io last errno must be zero: 0 ***
*** io last error must be blank: ***
*** sql last errno must be zero: 0 ***
*** sql last error must be blank: ***
mysql-test/t/ctype_cp932_binlog_stm.test
View file @
690a117d
...
...
@@ -22,7 +22,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
SELECT
HEX
(
s1
),
HEX
(
s2
),
d
FROM
t4
|
DROP
PROCEDURE
bug18293
|
DROP
TABLE
t4
|
SHOW
BINLOG
EVENTS
FROM
3
69
|
SHOW
BINLOG
EVENTS
FROM
3
70
|
delimiter
;
|
--
echo
End
of
5.0
tests
...
...
@@ -31,8 +31,9 @@ delimiter ;|
# #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump
# Note: 364 is a magic position (found experimentally, depends on
# the log's contents) that caused the server crash.
--
error
1220
SHOW
BINLOG
EVENTS
FROM
36
4
;
SHOW
BINLOG
EVENTS
FROM
36
5
;
--
echo
Bug
#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE
TABLE
t1
(
a
varchar
(
16
))
character
set
cp932
;
...
...
mysql-test/t/ctype_gbk_binlog.test
0 → 100644
View file @
690a117d
--
source
include
/
have_binlog_format_mixed_or_statement
.
inc
--
source
include
/
have_gbk
.
inc
SET
NAMES
gbk
;
--
character_set
gbk
CREATE
TABLE
t1
(
f1
BLOB
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
gbk
;
delimiter
|
;
CREATE
PROCEDURE
p1
(
IN
val
BLOB
)
BEGIN
SET
@
tval
=
val
;
SET
@
sql_cmd
=
CONCAT_WS
(
' '
,
'insert into t1(f1) values(?)'
);
PREPARE
stmt
FROM
@
sql_cmd
;
EXECUTE
stmt
USING
@
tval
;
DEALLOCATE
PREPARE
stmt
;
END
|
delimiter
;
|
SET
@
`tcontent`
:=
_binary
0x50434B000900000000000000E9000000
COLLATE
`binary`
/*!*/
;
CALL
p1
(
@
`tcontent`
);
FLUSH
LOGS
;
DROP
PROCEDURE
p1
;
RENAME
TABLE
t1
to
t2
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
--
exec
$MYSQL_BINLOG
--
force
-
if
-
open
--
short
-
form
$MYSQLD_DATADIR
/
master
-
bin
.
000001
|
$MYSQL
SELECT
hex
(
f1
)
FROM
t2
;
SELECT
hex
(
f1
)
FROM
t1
;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
mysql-test/t/trigger_notembedded.test
View file @
690a117d
...
...
@@ -909,4 +909,27 @@ select * from t1;
drop
table
t1
;
disconnect
flush
;
#
# Bug#45412 SHOW CREATE TRIGGER does not require privileges to disclose trigger data
#
CREATE
DATABASE
db1
;
CREATE
TABLE
db1
.
t1
(
a
char
(
30
))
ENGINE
=
MEMORY
;
CREATE
TRIGGER
db1
.
trg
AFTER
INSERT
ON
db1
.
t1
FOR
EACH
ROW
INSERT
INTO
db1
.
t1
VALUES
(
'Some very sensitive data goes here'
);
CREATE
USER
'no_rights'
@
'localhost'
;
REVOKE
ALL
ON
*.*
FROM
'no_rights'
@
'localhost'
;
FLUSH
PRIVILEGES
;
connect
(
con1
,
localhost
,
no_rights
,,);
SELECT
trigger_name
FROM
INFORMATION_SCHEMA
.
TRIGGERS
WHERE
trigger_schema
=
'db1'
;
--
error
ER_SPECIFIC_ACCESS_DENIED_ERROR
SHOW
CREATE
TRIGGER
db1
.
trg
;
connection
default
;
disconnect
con1
;
DROP
USER
'no_rights'
@
'localhost'
;
DROP
DATABASE
db1
;
--
echo
End
of
5.1
tests
.
mysys/my_getopt.c
View file @
690a117d
...
...
@@ -20,6 +20,7 @@
#include <mysys_err.h>
#include <my_getopt.h>
#include <errno.h>
#include <m_string.h>
typedef
void
(
*
init_func_p
)(
const
struct
my_option
*
option
,
uchar
*
*
variable
,
longlong
value
);
...
...
@@ -649,8 +650,18 @@ static int setval(const struct my_option *opts, uchar* *value, char *argument,
return
EXIT_OUT_OF_MEMORY
;
break
;
case
GET_ENUM
:
if
(((
*
(
int
*
)
result_pos
)
=
find_type
(
argument
,
opts
->
typelib
,
2
)
-
1
)
<
0
)
return
EXIT_ARGUMENT_INVALID
;
if
(((
*
(
int
*
)
result_pos
)
=
find_type
(
argument
,
opts
->
typelib
,
2
)
-
1
)
<
0
)
{
/*
Accept an integer representation of the enumerated item.
*/
char
*
endptr
;
unsigned
int
arg
=
(
unsigned
int
)
strtol
(
argument
,
&
endptr
,
10
);
if
(
*
endptr
||
arg
>=
opts
->
typelib
->
count
)
return
EXIT_ARGUMENT_INVALID
;
*
(
int
*
)
result_pos
=
arg
;
}
break
;
case
GET_SET
:
*
((
ulonglong
*
)
result_pos
)
=
find_typeset
(
argument
,
opts
->
typelib
,
&
err
);
...
...
sql/item.cc
View file @
690a117d
...
...
@@ -2771,8 +2771,8 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
CHARSET_INFO
*
tocs
=
thd
->
variables
.
collation_connection
;
uint32
dummy_offset
;
value
.
cs_info
.
character_set_of_placeholder
=
value
.
cs_info
.
character_set_client
=
fromcs
;
value
.
cs_info
.
character_set_of_placeholder
=
fromcs
;
value
.
cs_info
.
character_set_client
=
thd
->
variables
.
character_set_client
;
/*
Setup source and destination character sets so that they
are different only if conversion is necessary: this will
...
...
sql/slave.cc
View file @
690a117d
...
...
@@ -2418,6 +2418,7 @@ pthread_handler_t handle_slave_io(void *arg)
pthread_detach_this_thread
();
thd
->
thread_stack
=
(
char
*
)
&
thd
;
// remember where our stack is
mi
->
clear_error
();
if
(
init_slave_thread
(
thd
,
SLAVE_THD_IO
))
{
pthread_cond_broadcast
(
&
mi
->
start_cond
);
...
...
@@ -2532,6 +2533,7 @@ requesting master dump") ||
goto
connected
;
});
DBUG_ASSERT
(
mi
->
last_error
().
number
==
0
);
while
(
!
io_slave_killed
(
thd
,
mi
))
{
ulong
event_len
;
...
...
@@ -3731,6 +3733,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
if
(
!
slave_was_killed
)
{
mi
->
clear_error
();
// clear possible left over reconnect error
if
(
reconnect
)
{
if
(
!
suppress_warnings
&&
global_system_variables
.
log_warnings
)
...
...
sql/sql_repl.cc
View file @
690a117d
...
...
@@ -1043,6 +1043,7 @@ int reset_slave(THD *thd, Master_info* mi)
Reset errors (the idea is that we forget about the
old master).
*/
mi
->
clear_error
();
mi
->
rli
.
clear_error
();
mi
->
rli
.
clear_until_condition
();
...
...
sql/sql_show.cc
View file @
690a117d
...
...
@@ -7071,6 +7071,12 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name)
if
(
!
lst
)
return
TRUE
;
if
(
check_table_access
(
thd
,
TRIGGER_ACL
,
lst
,
1
,
TRUE
))
{
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
"TRIGGER"
);
return
TRUE
;
}
/*
Open the table by name in order to load Table_triggers_list object.
...
...
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