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
b49abf42
Commit
b49abf42
authored
May 25, 2007
by
ramil/ram@ramil.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/ram/work/mysql-5.0-maint
into mysql.com:/home/ram/work/b26842/b26842.5.0
parents
3545f28c
2c759bd4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
45 deletions
+97
-45
mysql-test/r/ctype_cp932_binlog.result
mysql-test/r/ctype_cp932_binlog.result
+7
-8
mysql-test/r/ctype_cp932_notembedded.result
mysql-test/r/ctype_cp932_notembedded.result
+1
-2
mysql-test/r/rpl_user_variables.result
mysql-test/r/rpl_user_variables.result
+37
-3
mysql-test/t/ctype_cp932_binlog.test
mysql-test/t/ctype_cp932_binlog.test
+1
-1
mysql-test/t/rpl_user_variables.test
mysql-test/t/rpl_user_variables.test
+39
-6
sql/sql_prepare.cc
sql/sql_prepare.cc
+12
-25
No files found.
mysql-test/r/ctype_cp932_binlog.result
View file @
b49abf42
...
@@ -9,8 +9,7 @@ EXECUTE stmt1 USING @var1;
...
@@ -9,8 +9,7 @@ EXECUTE stmt1 USING @var1;
SHOW BINLOG EVENTS FROM 98;
SHOW BINLOG EVENTS FROM 98;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 188 User var 1 227 @`var1`=_binary 0x8300 COLLATE binary
master-bin.000001 188 Query 1 283 use `test`; INSERT INTO t1 VALUES(0x8300)
master-bin.000001 227 Query 1 323 use `test`; INSERT INTO t1 VALUES(@'var1')
SELECT HEX(f1) FROM t1;
SELECT HEX(f1) FROM t1;
HEX(f1)
HEX(f1)
8300
8300
...
@@ -30,17 +29,17 @@ HEX(s1) HEX(s2) d
...
@@ -30,17 +29,17 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP PROCEDURE bug18293|
DROP TABLE t4|
DROP TABLE t4|
SHOW BINLOG EVENTS FROM
40
2|
SHOW BINLOG EVENTS FROM
36
2|
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001
402 Query 1 56
8 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
master-bin.000001
362 Query 1 52
8 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
d DECIMAL(10,2))
master-bin.000001 5
68 Query 1 81
6 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
master-bin.000001 5
28 Query 1 77
6 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
IN ind DECIMAL(10,2))
BEGIN
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
END
master-bin.000001
816 Query 1 103
5 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001
776 Query 1 99
5 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001
1035 Query 1 112
4 use `test`; DROP PROCEDURE bug18293
master-bin.000001
995 Query 1 108
4 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1
124 Query 1 120
3 use `test`; DROP TABLE t4
master-bin.000001 1
084 Query 1 116
3 use `test`; DROP TABLE t4
mysql-test/r/ctype_cp932_notembedded.result
View file @
b49abf42
...
@@ -9,8 +9,7 @@ EXECUTE stmt1 USING @var1;
...
@@ -9,8 +9,7 @@ EXECUTE stmt1 USING @var1;
SHOW BINLOG EVENTS FROM 98;
SHOW BINLOG EVENTS FROM 98;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 188 User var 1 227 @`var1`=_binary 0x8300 COLLATE binary
master-bin.000001 188 Query 1 283 use `test`; INSERT INTO t1 VALUES(0x8300)
master-bin.000001 227 Query 1 323 use `test`; INSERT INTO t1 VALUES(@'var1')
SELECT HEX(f1) FROM t1;
SELECT HEX(f1) FROM t1;
HEX(f1)
HEX(f1)
8300
8300
...
...
mysql-test/r/rpl_user_variables.result
View file @
b49abf42
...
@@ -253,10 +253,44 @@ SELECT * from t2;
...
@@ -253,10 +253,44 @@ SELECT * from t2;
k
k
100
100
42
42
drop table t1, t2;
reset master;
create table t1 (a int);
prepare s from "insert into t1 values (@a),(?)";
set @a=98;
execute s using @a;
prepare s from "insert into t1 values (?)";
set @a=99;
execute s using @a;
prepare s from "insert into t1 select 100 limit ?";
set @a=100;
execute s using @a;
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 98 Query 1 184 use `test`; create table t1 (a int)
slave-bin.000001 184 User var 2 226 @`a`=98
slave-bin.000001 226 Query 1 320 use `test`; insert into t1 values (@a),(98)
slave-bin.000001 320 Query 1 409 use `test`; insert into t1 values (99)
slave-bin.000001 409 Query 1 507 use `test`; insert into t1 select 100 limit 100
select * from t1;
a
98
98
99
100
drop table t1;
create table t1(a int, b int);
prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
set @x=1;
execute s1 using @x;
select * from t1;
a b
2 1
select * from t1;
a b
2 1
drop table t1;
End of 5.0 tests.
End of 5.0 tests.
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP FUNCTION IF EXISTS f2;
CREATE TABLE t1 (i INT);
CREATE TABLE t1 (i INT);
...
...
mysql-test/t/ctype_cp932_binlog.test
View file @
b49abf42
...
@@ -51,7 +51,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
...
@@ -51,7 +51,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
SELECT
HEX
(
s1
),
HEX
(
s2
),
d
FROM
t4
|
SELECT
HEX
(
s1
),
HEX
(
s2
),
d
FROM
t4
|
DROP
PROCEDURE
bug18293
|
DROP
PROCEDURE
bug18293
|
DROP
TABLE
t4
|
DROP
TABLE
t4
|
SHOW
BINLOG
EVENTS
FROM
40
2
|
SHOW
BINLOG
EVENTS
FROM
36
2
|
delimiter
;
|
delimiter
;
|
# End of 5.0 tests
# End of 5.0 tests
mysql-test/t/rpl_user_variables.test
View file @
b49abf42
...
@@ -296,13 +296,48 @@ SELECT * from t1;
...
@@ -296,13 +296,48 @@ SELECT * from t1;
SELECT
*
from
t2
;
SELECT
*
from
t2
;
connection
master
;
connection
master
;
drop
table
t1
,
t2
;
--
echo
End
of
5.0
tests
.
#
# Bug #26842: master binary log contains invalid queries - replication fails
#
save_master_pos
;
connection
slave
;
sync_with_master
;
reset
master
;
# Cleanup
connection
master
;
create
table
t1
(
a
int
);
prepare
s
from
"insert into t1 values (@a),(?)"
;
set
@
a
=
98
;
execute
s
using
@
a
;
prepare
s
from
"insert into t1 values (?)"
;
set
@
a
=
99
;
execute
s
using
@
a
;
prepare
s
from
"insert into t1 select 100 limit ?"
;
set
@
a
=
100
;
execute
s
using
@
a
;
DROP
TABLE
t1
;
save_master_pos
;
DROP
TABLE
t2
;
connection
slave
;
sync_with_master
;
show
binlog
events
from
98
;
select
*
from
t1
;
connection
master
;
drop
table
t1
;
#
# Bug #12826: Possible to get inconsistent slave using SQL syntax Prepared Statements
#
connection
master
;
create
table
t1
(
a
int
,
b
int
);
prepare
s1
from
'insert into t1 values (@x:=@x+1, ?)'
;
set
@
x
=
1
;
execute
s1
using
@
x
;
select
*
from
t1
;
sync_slave_with_master
;
connection
slave
;
select
*
from
t1
;
connection
master
;
drop
table
t1
;
--
echo
End
of
5.0
tests
.
# This test uses a stored function that uses user-defined variables to return data
# This test uses a stored function that uses user-defined variables to return data
# The test ensures the value of the user-defined variable is replicated correctly
# The test ensures the value of the user-defined variable is replicated correctly
...
@@ -310,7 +345,6 @@ DROP TABLE t2;
...
@@ -310,7 +345,6 @@ DROP TABLE t2;
# This test was constructed for BUG#20141
# This test was constructed for BUG#20141
--
disable_warnings
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
DROP
FUNCTION
IF
EXISTS
f1
;
DROP
FUNCTION
IF
EXISTS
f1
;
DROP
FUNCTION
IF
EXISTS
f2
;
DROP
FUNCTION
IF
EXISTS
f2
;
--
enable_warnings
--
enable_warnings
...
@@ -358,4 +392,3 @@ DROP TABLE t1;
...
@@ -358,4 +392,3 @@ DROP TABLE t1;
sync_slave_with_master
;
sync_slave_with_master
;
stop
slave
;
stop
slave
;
sql/sql_prepare.cc
View file @
b49abf42
...
@@ -969,6 +969,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
...
@@ -969,6 +969,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
String
buf
;
String
buf
;
const
String
*
val
;
const
String
*
val
;
uint32
length
=
0
;
uint32
length
=
0
;
THD
*
thd
=
stmt
->
thd
;
DBUG_ENTER
(
"insert_params_from_vars"
);
DBUG_ENTER
(
"insert_params_from_vars"
);
...
@@ -979,34 +980,20 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
...
@@ -979,34 +980,20 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
{
{
Item_param
*
param
=
*
it
;
Item_param
*
param
=
*
it
;
varname
=
var_it
++
;
varname
=
var_it
++
;
if
(
get_var_with_binlog
(
stmt
->
thd
,
stmt
->
lex
->
sql_command
,
*
varname
,
&
entry
))
DBUG_RETURN
(
1
);
if
(
param
->
set_from_user_var
(
stmt
->
thd
,
entry
))
entry
=
(
user_var_entry
*
)
hash_search
(
&
thd
->
user_vars
,
(
byte
*
)
varname
->
str
,
DBUG_RETURN
(
1
);
varname
->
length
);
/* Insert @'escaped-varname' instead of parameter in the query */
/*
if
(
entry
)
We have to call the setup_one_conversion_function() here to set
{
the parameter's members that might be needed further
char
*
start
,
*
ptr
;
(e.g. value.cs_info.character_set_client is used in the query_val_str()).
buf
.
length
(
0
);
*/
if
(
buf
.
reserve
(
entry
->
name
.
length
*
2
+
3
))
setup_one_conversion_function
(
thd
,
param
,
param
->
param_type
);
if
(
param
->
set_from_user_var
(
thd
,
entry
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
val
=
param
->
query_val_str
(
&
buf
);
start
=
ptr
=
buf
.
c_ptr_quick
();
if
(
param
->
convert_str_value
(
thd
))
*
ptr
++=
'@'
;
*
ptr
++=
'\''
;
ptr
+=
escape_string_for_mysql
(
&
my_charset_utf8_general_ci
,
ptr
,
0
,
entry
->
name
.
str
,
entry
->
name
.
length
);
*
ptr
++=
'\''
;
buf
.
length
(
ptr
-
start
);
val
=
&
buf
;
}
else
val
=
&
my_null_string
;
if
(
param
->
convert_str_value
(
stmt
->
thd
))
DBUG_RETURN
(
1
);
/* out of memory */
DBUG_RETURN
(
1
);
/* out of memory */
if
(
query
->
replace
(
param
->
pos_in_query
+
length
,
1
,
*
val
))
if
(
query
->
replace
(
param
->
pos_in_query
+
length
,
1
,
*
val
))
...
...
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