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
c882b871
Commit
c882b871
authored
Mar 26, 2008
by
istruewing@stella.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge stella.local:/home2/mydev/mysql-5.1-ateam
into stella.local:/home2/mydev/mysql-5.1-axmrg
parents
0eff6e7b
2d44db25
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
152 additions
and
31 deletions
+152
-31
mysql-test/r/federated.result
mysql-test/r/federated.result
+2
-0
mysql-test/suite/binlog/r/binlog_stm_ps.result
mysql-test/suite/binlog/r/binlog_stm_ps.result
+2
-0
mysql-test/suite/binlog/r/binlog_unsafe.result
mysql-test/suite/binlog/r/binlog_unsafe.result
+28
-0
mysql-test/suite/binlog/t/binlog_stm_ps.test
mysql-test/suite/binlog/t/binlog_stm_ps.test
+1
-1
mysql-test/suite/binlog/t/binlog_unsafe.test
mysql-test/suite/binlog/t/binlog_unsafe.test
+21
-0
mysql-test/suite/rpl/t/rpl_optimize.test
mysql-test/suite/rpl/t/rpl_optimize.test
+2
-0
mysql-test/suite/rpl/t/rpl_user_variables.test
mysql-test/suite/rpl/t/rpl_user_variables.test
+2
-0
mysql-test/t/federated.test
mysql-test/t/federated.test
+6
-0
sql/sql_delete.cc
sql/sql_delete.cc
+13
-0
sql/sql_insert.cc
sql/sql_insert.cc
+13
-0
sql/sql_parse.cc
sql/sql_parse.cc
+2
-0
sql/sql_servers.cc
sql/sql_servers.cc
+47
-29
sql/sql_update.cc
sql/sql_update.cc
+13
-0
storage/federated/ha_federated.cc
storage/federated/ha_federated.cc
+0
-1
No files found.
mysql-test/r/federated.result
View file @
c882b871
...
...
@@ -2092,6 +2092,8 @@ DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
DROP TABLE t1;
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
End of 5.1 tests
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
...
...
mysql-test/suite/binlog/r/binlog_stm_ps.result
View file @
c882b871
...
...
@@ -10,6 +10,8 @@ execute s using @a;
prepare s from "insert into t1 select 100 limit ?";
set @a=100;
execute s using @a;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
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 (a int)
...
...
mysql-test/suite/binlog/r/binlog_unsafe.result
View file @
c882b871
...
...
@@ -192,3 +192,31 @@ DROP PROCEDURE proc4;
DROP FUNCTION func5;
DROP PREPARE prep6;
DROP TABLE t1, t2, t3, trigger_table, trigger_table2;
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
UPDATE t1 SET a=1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
DELETE FROM t1 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
CREATE PROCEDURE p1()
BEGIN
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
UPDATE t1 SET a=1 LIMIT 1;
DELETE FROM t1 LIMIT 1;
END|
CALL p1();
Warnings:
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
mysql-test/suite/binlog/t/binlog_stm_ps.test
View file @
c882b871
# This test is to verify replication with PS
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_binlog_format_
mixed_or_
statement
.
inc
--
source
include
/
have_binlog_format_statement
.
inc
--
disable_query_log
reset
master
;
# get rid of previous tests binlog
...
...
mysql-test/suite/binlog/t/binlog_unsafe.test
View file @
c882b871
...
...
@@ -236,3 +236,24 @@ DROP PROCEDURE proc4;
DROP
FUNCTION
func5
;
DROP
PREPARE
prep6
;
DROP
TABLE
t1
,
t2
,
t3
,
trigger_table
,
trigger_table2
;
#
# BUG#34768 - nondeterministic INSERT using LIMIT logged in stmt mode if
# binlog_format=mixed
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
KEY
(
a
),
PRIMARY
KEY
(
b
));
INSERT
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
REPLACE
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
UPDATE
t1
SET
a
=
1
LIMIT
1
;
DELETE
FROM
t1
LIMIT
1
;
delimiter
|
;
CREATE
PROCEDURE
p1
()
BEGIN
INSERT
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
REPLACE
INTO
t1
SELECT
*
FROM
t1
LIMIT
1
;
UPDATE
t1
SET
a
=
1
LIMIT
1
;
DELETE
FROM
t1
LIMIT
1
;
END
|
delimiter
;
|
CALL
p1
();
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
;
mysql-test/suite/rpl/t/rpl_optimize.test
View file @
c882b871
...
...
@@ -31,7 +31,9 @@ INSERT INTO t1 (a) SELECT null FROM t1;
save_master_pos
;
# a few updates to force OPTIMIZE to do something
update
t1
set
b
=
(
a
/
2
*
rand
());
--
disable_warnings
delete
from
t1
order
by
b
limit
10000
;
--
enable_warnings
connection
slave
;
sync_with_master
;
...
...
mysql-test/suite/rpl/t/rpl_user_variables.test
View file @
c882b871
...
...
@@ -315,7 +315,9 @@ create table t1(a int);
insert
into
t1
values
(
1
),(
2
);
prepare
s1
from
'insert into t1 select a from t1 limit ?'
;
set
@
x
=
'1.1'
;
--
disable_warnings
execute
s1
using
@
x
;
--
enable_warnings
select
*
from
t1
;
sync_slave_with_master
;
connection
slave
;
...
...
mysql-test/t/federated.test
View file @
c882b871
...
...
@@ -1828,5 +1828,11 @@ DROP TABLE t1;
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
federated
CONNECTION
=
'mysql://@:://'
;
DROP
TABLE
t1
;
#
# Coverage testing of CREATE SERVER.
#
create
server
's1'
foreign
data
wrapper
'mysql'
options
(
port
3306
);
drop
server
's1'
;
--
echo
End
of
5.1
tests
source
include
/
federated_cleanup
.
inc
;
sql/sql_delete.cc
View file @
c882b871
...
...
@@ -418,6 +418,19 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
DBUG_ENTER
(
"mysql_prepare_delete"
);
List
<
Item
>
all_fields
;
/*
Statement-based replication of DELETE ... LIMIT is not safe as order of
rows is not defined, so in mixed mode we go to row-based.
Note that we may consider a statement as safe if ORDER BY primary_key
is present. However it may confuse users to see very similiar statements
replicated differently.
*/
if
(
thd
->
lex
->
current_select
->
select_limit
)
{
thd
->
lex
->
set_stmt_unsafe
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
}
thd
->
lex
->
allow_sum_func
=
0
;
if
(
setup_tables_and_check_access
(
thd
,
&
thd
->
lex
->
select_lex
.
context
,
&
thd
->
lex
->
select_lex
.
top_join_list
,
...
...
sql/sql_insert.cc
View file @
c882b871
...
...
@@ -2763,6 +2763,19 @@ bool mysql_insert_select_prepare(THD *thd)
TABLE_LIST
*
first_select_leaf_table
;
DBUG_ENTER
(
"mysql_insert_select_prepare"
);
/*
Statement-based replication of INSERT ... SELECT ... LIMIT is not safe
as order of rows is not defined, so in mixed mode we go to row-based.
Note that we may consider a statement as safe if ORDER BY primary_key
is present or we SELECT a constant. However it may confuse users to
see very similiar statements replicated differently.
*/
if
(
lex
->
current_select
->
select_limit
)
{
lex
->
set_stmt_unsafe
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
}
/*
SELECT_LEX do not belong to INSERT statement, so we can't add WHERE
clause if table is VIEW
...
...
sql/sql_parse.cc
View file @
c882b871
...
...
@@ -6464,6 +6464,8 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
result
=
1
;
if
(
grant_reload
(
thd
))
result
=
1
;
if
(
servers_reload
(
thd
))
result
=
1
;
/* purecov: inspected */
}
if
(
tmp_thd
)
{
...
...
sql/sql_servers.cc
View file @
c882b871
...
...
@@ -55,8 +55,8 @@ static bool get_server_from_table_to_cache(TABLE *table);
static
int
insert_server
(
THD
*
thd
,
FOREIGN_SERVER
*
server_options
);
static
int
insert_server_record
(
TABLE
*
table
,
FOREIGN_SERVER
*
server
);
static
int
insert_server_record_into_cache
(
FOREIGN_SERVER
*
server
);
static
void
prepare_server_struct_for_insert
(
LEX_SERVER_OPTIONS
*
server_options
,
FOREIGN_SERVER
*
server
);
static
FOREIGN_SERVER
*
prepare_server_struct_for_insert
(
LEX_SERVER_OPTIONS
*
server_options
);
/* drop functions */
static
int
delete_server_record
(
TABLE
*
table
,
char
*
server_name
,
...
...
@@ -166,6 +166,9 @@ end:
RETURN VALUES
FALSE Success
TRUE Error
TODO
Revert back to old list if we failed to load new one.
*/
static
bool
servers_load
(
THD
*
thd
,
TABLE_LIST
*
tables
)
...
...
@@ -175,10 +178,9 @@ static bool servers_load(THD *thd, TABLE_LIST *tables)
bool
return_val
=
TRUE
;
DBUG_ENTER
(
"servers_load"
);
/* first, send all cached rows to sleep with the fishes, oblivion!
I expect this crappy comment replaced */
free_root
(
&
mem
,
MYF
(
MY_MARK_BLOCKS_FREE
));
my_hash_reset
(
&
servers_cache
);
free_root
(
&
mem
,
MYF
(
0
));
init_alloc_root
(
&
mem
,
ACL_ALLOC_BLOCK_SIZE
,
0
);
init_read_record
(
&
read_record_info
,
thd
,
table
=
tables
[
0
].
table
,
NULL
,
1
,
0
);
while
(
!
(
read_record_info
.
read_record
(
&
read_record_info
)))
...
...
@@ -966,10 +968,14 @@ int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options)
server_options
->
server_name_length
))
goto
end
;
server
=
(
FOREIGN_SERVER
*
)
alloc_root
(
&
mem
,
sizeof
(
FOREIGN_SERVER
));
prepare_server_struct_for_insert
(
server_options
,
server
);
if
(
!
(
server
=
prepare_server_struct_for_insert
(
server_options
)))
{
/* purecov: begin inspected */
error
=
ER_OUT_OF_RESOURCES
;
goto
end
;
/* purecov: end */
}
error
=
insert_server
(
thd
,
server
);
...
...
@@ -1040,52 +1046,64 @@ end:
SYNOPSIS
prepare_server_struct_for_insert()
LEX_SERVER_OPTIONS *server_options
FOREIGN_SERVER *server
NOTES
As FOREIGN_SERVER members are allocated on mem_root, we do not need to
free them in case of error.
RETURN VALUE
none
On success filled FOREIGN_SERVER, or NULL in case out of memory.
*/
static
void
prepare_server_struct_for_insert
(
LEX_SERVER_OPTIONS
*
server_options
,
FOREIGN_SERVER
*
server
)
static
FOREIGN_SERVER
*
prepare_server_struct_for_insert
(
LEX_SERVER_OPTIONS
*
server_options
)
{
char
*
unset_ptr
=
(
char
*
)
""
;
FOREIGN_SERVER
*
server
;
DBUG_ENTER
(
"prepare_server_struct"
);
if
(
!
(
server
=
(
FOREIGN_SERVER
*
)
alloc_root
(
&
mem
,
sizeof
(
FOREIGN_SERVER
))))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
/* these two MUST be set */
server
->
server_name
=
strdup_root
(
&
mem
,
server_options
->
server_name
);
if
(
!
(
server
->
server_name
=
strdup_root
(
&
mem
,
server_options
->
server_name
)))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
server
->
server_name_length
=
server_options
->
server_name_length
;
server
->
host
=
server_options
->
host
?
strdup_root
(
&
mem
,
server_options
->
host
)
:
unset_ptr
;
if
(
!
(
server
->
host
=
server_options
->
host
?
strdup_root
(
&
mem
,
server_options
->
host
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
server
->
db
=
server_options
->
db
?
strdup_root
(
&
mem
,
server_options
->
db
)
:
unset_ptr
;
if
(
!
(
server
->
db
=
server_options
->
db
?
strdup_root
(
&
mem
,
server_options
->
db
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
server
->
username
=
server_options
->
username
?
strdup_root
(
&
mem
,
server_options
->
username
)
:
unset_ptr
;
if
(
!
(
server
->
username
=
server_options
->
username
?
strdup_root
(
&
mem
,
server_options
->
username
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
server
->
password
=
server_options
->
password
?
strdup_root
(
&
mem
,
server_options
->
password
)
:
unset_ptr
;
if
(
!
(
server
->
password
=
server_options
->
password
?
strdup_root
(
&
mem
,
server_options
->
password
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
/* set to 0 if not specified */
server
->
port
=
server_options
->
port
>
-
1
?
server_options
->
port
:
0
;
server
->
socket
=
server_options
->
socket
?
strdup_root
(
&
mem
,
server_options
->
socket
)
:
unset_ptr
;
if
(
!
(
server
->
socket
=
server_options
->
socket
?
strdup_root
(
&
mem
,
server_options
->
socket
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
server
->
scheme
=
server_options
->
scheme
?
strdup_root
(
&
mem
,
server_options
->
scheme
)
:
unset_ptr
;
if
(
!
(
server
->
scheme
=
server_options
->
scheme
?
strdup_root
(
&
mem
,
server_options
->
scheme
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
server
->
owner
=
server_options
->
owner
?
strdup_root
(
&
mem
,
server_options
->
owner
)
:
unset_ptr
;
if
(
!
(
server
->
owner
=
server_options
->
owner
?
strdup_root
(
&
mem
,
server_options
->
owner
)
:
unset_ptr
))
DBUG_RETURN
(
NULL
);
/* purecov: inspected */
DBUG_
VOID_RETURN
;
DBUG_
RETURN
(
server
)
;
}
/*
...
...
sql/sql_update.cc
View file @
c882b871
...
...
@@ -859,6 +859,19 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
SELECT_LEX
*
select_lex
=
&
thd
->
lex
->
select_lex
;
DBUG_ENTER
(
"mysql_prepare_update"
);
/*
Statement-based replication of UPDATE ... LIMIT is not safe as order of
rows is not defined, so in mixed mode we go to row-based.
Note that we may consider a statement as safe if ORDER BY primary_key
is present. However it may confuse users to see very similiar statements
replicated differently.
*/
if
(
thd
->
lex
->
current_select
->
select_limit
)
{
thd
->
lex
->
set_stmt_unsafe
();
thd
->
set_current_stmt_binlog_row_based_if_mixed
();
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list
->
grant
.
want_privilege
=
table
->
grant
.
want_privilege
=
(
SELECT_ACL
&
~
table
->
grant
.
privilege
);
...
...
storage/federated/ha_federated.cc
View file @
c882b871
...
...
@@ -847,7 +847,6 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
if
(
!
share
->
port
)
{
if
(
!
share
->
hostname
||
strcmp
(
share
->
hostname
,
my_localhost
)
==
0
)
share
->
socket
=
(
char
*
)
MYSQL_UNIX_ADDR
;
else
share
->
port
=
MYSQL_PORT
;
}
...
...
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