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
3cb82b62
Commit
3cb82b62
authored
Apr 10, 2014
by
andrew
Browse files
Options
Browse Files
Download
Plain Diff
Merged maria trunk
parents
97954225
5fffa449
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
130 additions
and
15 deletions
+130
-15
config.h.cmake
config.h.cmake
+8
-0
mysql-test/r/subselect_exists2in.result
mysql-test/r/subselect_exists2in.result
+23
-0
mysql-test/suite/rpl/r/rpl_parallel.result
mysql-test/suite/rpl/r/rpl_parallel.result
+19
-1
mysql-test/suite/rpl/t/rpl_parallel.test
mysql-test/suite/rpl/t/rpl_parallel.test
+42
-1
mysql-test/t/subselect_exists2in.test
mysql-test/t/subselect_exists2in.test
+25
-0
sql/item_subselect.cc
sql/item_subselect.cc
+5
-9
sql/rpl_parallel.cc
sql/rpl_parallel.cc
+7
-3
sql/slave.cc
sql/slave.cc
+1
-1
No files found.
config.h.cmake
View file @
3cb82b62
...
@@ -643,4 +643,12 @@
...
@@ -643,4 +643,12 @@
#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
#cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@
#cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@
#ifdef _AIX
/*
AIX includes inttypes.h from sys/types.h
Explicitly request format macros before the first inclusion of inttypes.h
*/
#define __STDC_FORMAT_MACROS
#endif
#endif
#endif
mysql-test/r/subselect_exists2in.result
View file @
3cb82b62
...
@@ -862,4 +862,27 @@ i c1 c2 t1_field t2_field
...
@@ -862,4 +862,27 @@ i c1 c2 t1_field t2_field
drop table t1,t2,t3;
drop table t1,t2,t3;
set optimizer_switch=default;
set optimizer_switch=default;
set optimizer_switch='exists_to_in=on';
set optimizer_switch='exists_to_in=on';
#
#MDEV-5401: Wrong result (missing row) on a 2nd execution of PS with
#exists_to_in=on, MERGE view or a SELECT SQ
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (2),(3);
SELECT * FROM v1 WHERE EXISTS ( SELECT * FROM t2 t2x, t2 t2y WHERE t2y.b = a );
a
2
PREPARE stmt FROM "SELECT * FROM v1 WHERE EXISTS ( SELECT * FROM t2 t2x, t2 t2y WHERE t2y.b = a )";
EXECUTE stmt;
a
2
EXECUTE stmt;
a
2
deallocate prepare stmt;
drop view v1;
drop table t1,t2;
# End of 10.0 tests
set optimizer_switch=default;
set optimizer_switch=default;
mysql-test/suite/rpl/r/rpl_parallel.result
View file @
3cb82b62
...
@@ -801,11 +801,29 @@ a b
...
@@ -801,11 +801,29 @@ a b
5 NULL
5 NULL
6 6
6 6
7 NULL
7 NULL
*** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication ***
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=1;
SET DEBUG_SYNC= 'RESET';
include/start_slave.inc
CREATE TABLE t5 (a INT PRIMARY KEY, b INT);
INSERT INTO t5 VALUES (1,1);
INSERT INTO t5 VALUES (2,2), (3,8);
INSERT INTO t5 VALUES (4,16);
test_check
OK
test_check
OK
FLUSH LOGS;
test_check
OK
test_check
OK
include/stop_slave.inc
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
include/start_slave.inc
SET DEBUG_SYNC= 'RESET';
SET DEBUG_SYNC= 'RESET';
DROP function foo;
DROP function foo;
DROP TABLE t1,t2,t3,t4;
DROP TABLE t1,t2,t3,t4
,t5
;
SET DEBUG_SYNC= 'RESET';
SET DEBUG_SYNC= 'RESET';
include/rpl_end.inc
include/rpl_end.inc
mysql-test/suite/rpl/t/rpl_parallel.test
View file @
3cb82b62
...
@@ -1250,6 +1250,47 @@ SET debug_sync='RESET';
...
@@ -1250,6 +1250,47 @@ SET debug_sync='RESET';
SELECT
*
FROM
t4
ORDER
BY
a
;
SELECT
*
FROM
t4
ORDER
BY
a
;
--
echo
***
MDEV
-
5938
:
Exec_master_log_pos
not
updated
at
log
rotate
in
parallel
replication
***
--
connection
server_2
--
source
include
/
stop_slave
.
inc
SET
GLOBAL
slave_parallel_threads
=
1
;
SET
DEBUG_SYNC
=
'RESET'
;
--
source
include
/
start_slave
.
inc
--
connection
server_1
CREATE
TABLE
t5
(
a
INT
PRIMARY
KEY
,
b
INT
);
INSERT
INTO
t5
VALUES
(
1
,
1
);
INSERT
INTO
t5
VALUES
(
2
,
2
),
(
3
,
8
);
INSERT
INTO
t5
VALUES
(
4
,
16
);
--
save_master_pos
--
connection
server_2
--
sync_with_master
let
$io_file
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Master_Log_File
,
1
);
let
$io_pos
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Read_Master_Log_Pos
,
1
);
let
$sql_file
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Relay_Master_Log_File
,
1
);
let
$sql_pos
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Exec_Master_Log_Pos
,
1
);
--
disable_query_log
eval
SELECT
IF
(
'$io_file'
=
'$sql_file'
,
"OK"
,
"Not ok,
$io_file
<>
$sql_file
"
)
AS
test_check
;
eval
SELECT
IF
(
'$io_pos'
=
'$sql_pos'
,
"OK"
,
"Not ok,
$io_pos
<>
$sql_pos
"
)
AS
test_check
;
--
enable_query_log
--
connection
server_1
FLUSH
LOGS
;
--
save_master_pos
--
connection
server_2
--
sync_with_master
let
$io_file
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Master_Log_File
,
1
);
let
$io_pos
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Read_Master_Log_Pos
,
1
);
let
$sql_file
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Relay_Master_Log_File
,
1
);
let
$sql_pos
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Exec_Master_Log_Pos
,
1
);
--
disable_query_log
eval
SELECT
IF
(
'$io_file'
=
'$sql_file'
,
"OK"
,
"Not ok,
$io_file
<>
$sql_file
"
)
AS
test_check
;
eval
SELECT
IF
(
'$io_pos'
=
'$sql_pos'
,
"OK"
,
"Not ok,
$io_pos
<>
$sql_pos
"
)
AS
test_check
;
--
enable_query_log
--
connection
server_2
--
connection
server_2
--
source
include
/
stop_slave
.
inc
--
source
include
/
stop_slave
.
inc
SET
GLOBAL
slave_parallel_threads
=@
old_parallel_threads
;
SET
GLOBAL
slave_parallel_threads
=@
old_parallel_threads
;
...
@@ -1258,7 +1299,7 @@ SET DEBUG_SYNC= 'RESET';
...
@@ -1258,7 +1299,7 @@ SET DEBUG_SYNC= 'RESET';
--
connection
server_1
--
connection
server_1
DROP
function
foo
;
DROP
function
foo
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
,
t5
;
SET
DEBUG_SYNC
=
'RESET'
;
SET
DEBUG_SYNC
=
'RESET'
;
--
source
include
/
rpl_end
.
inc
--
source
include
/
rpl_end
.
inc
mysql-test/t/subselect_exists2in.test
View file @
3cb82b62
...
@@ -735,5 +735,30 @@ drop table t1,t2,t3;
...
@@ -735,5 +735,30 @@ drop table t1,t2,t3;
set
optimizer_switch
=
default
;
set
optimizer_switch
=
default
;
set
optimizer_switch
=
'exists_to_in=on'
;
set
optimizer_switch
=
'exists_to_in=on'
;
--
echo
#
--
echo
#MDEV-5401: Wrong result (missing row) on a 2nd execution of PS with
--
echo
#exists_to_in=on, MERGE view or a SELECT SQ
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
ALGORITHM
=
MERGE
VIEW
v1
AS
SELECT
*
FROM
t1
;
CREATE
TABLE
t2
(
b
INT
)
ENGINE
=
MyISAM
;
INSERT
INTO
t2
VALUES
(
2
),(
3
);
SELECT
*
FROM
v1
WHERE
EXISTS
(
SELECT
*
FROM
t2
t2x
,
t2
t2y
WHERE
t2y
.
b
=
a
);
PREPARE
stmt
FROM
"SELECT * FROM v1 WHERE EXISTS ( SELECT * FROM t2 t2x, t2 t2y WHERE t2y.b = a )"
;
EXECUTE
stmt
;
EXECUTE
stmt
;
deallocate
prepare
stmt
;
drop
view
v1
;
drop
table
t1
,
t2
;
--
echo
# End of 10.0 tests
#restore defaults
#restore defaults
set
optimizer_switch
=
default
;
set
optimizer_switch
=
default
;
sql/item_subselect.cc
View file @
3cb82b62
...
@@ -2626,7 +2626,7 @@ static bool check_equality_for_exist2in(Item_func *func,
...
@@ -2626,7 +2626,7 @@ static bool check_equality_for_exist2in(Item_func *func,
typedef
struct
st_eq_field_outer
typedef
struct
st_eq_field_outer
{
{
Item
_func
**
eq_ref
;
Item
**
eq_ref
;
Item_ident
*
local_field
;
Item_ident
*
local_field
;
Item
*
outer_exp
;
Item
*
outer_exp
;
}
EQ_FIELD_OUTER
;
}
EQ_FIELD_OUTER
;
...
@@ -2665,7 +2665,7 @@ static bool find_inner_outer_equalities(Item **conds,
...
@@ -2665,7 +2665,7 @@ static bool find_inner_outer_equalities(Item **conds,
&
element
.
outer_exp
))
&
element
.
outer_exp
))
{
{
found
=
TRUE
;
found
=
TRUE
;
element
.
eq_ref
=
(
Item_func
**
)
li
.
ref
();
element
.
eq_ref
=
li
.
ref
();
if
(
result
.
append
(
element
))
if
(
result
.
append
(
element
))
goto
alloc_err
;
goto
alloc_err
;
}
}
...
@@ -2677,7 +2677,7 @@ static bool find_inner_outer_equalities(Item **conds,
...
@@ -2677,7 +2677,7 @@ static bool find_inner_outer_equalities(Item **conds,
&
element
.
outer_exp
))
&
element
.
outer_exp
))
{
{
found
=
TRUE
;
found
=
TRUE
;
element
.
eq_ref
=
(
Item_func
**
)
conds
;
element
.
eq_ref
=
conds
;
if
(
result
.
append
(
element
))
if
(
result
.
append
(
element
))
goto
alloc_err
;
goto
alloc_err
;
}
}
...
@@ -2700,7 +2700,7 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg)
...
@@ -2700,7 +2700,7 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg)
THD
*
thd
=
(
THD
*
)
opt_arg
;
THD
*
thd
=
(
THD
*
)
opt_arg
;
SELECT_LEX
*
first_select
=
unit
->
first_select
(),
*
save_select
;
SELECT_LEX
*
first_select
=
unit
->
first_select
(),
*
save_select
;
JOIN
*
join
=
first_select
->
join
;
JOIN
*
join
=
first_select
->
join
;
Item
_func
*
eq
=
NULL
,
**
eq_ref
=
NULL
;
Item
**
eq_ref
=
NULL
;
Item_ident
*
local_field
=
NULL
;
Item_ident
*
local_field
=
NULL
;
Item
*
outer_exp
=
NULL
;
Item
*
outer_exp
=
NULL
;
Item
*
left_exp
=
NULL
;
Item_in_subselect
*
in_subs
;
Item
*
left_exp
=
NULL
;
Item_in_subselect
*
in_subs
;
...
@@ -2774,7 +2774,6 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg)
...
@@ -2774,7 +2774,6 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg)
{
{
Item
*
item
=
it
++
;
Item
*
item
=
it
++
;
eq_ref
=
eqs
.
at
(
i
).
eq_ref
;
eq_ref
=
eqs
.
at
(
i
).
eq_ref
;
eq
=
*
eq_ref
;
local_field
=
eqs
.
at
(
i
).
local_field
;
local_field
=
eqs
.
at
(
i
).
local_field
;
outer_exp
=
eqs
.
at
(
i
).
outer_exp
;
outer_exp
=
eqs
.
at
(
i
).
outer_exp
;
/* Add the field to the SELECT_LIST */
/* Add the field to the SELECT_LIST */
...
@@ -2789,10 +2788,7 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg)
...
@@ -2789,10 +2788,7 @@ bool Item_exists_subselect::exists2in_processor(uchar *opt_arg)
/* remove the parts from condition */
/* remove the parts from condition */
if
(
!
upper_not
||
!
local_field
->
maybe_null
)
if
(
!
upper_not
||
!
local_field
->
maybe_null
)
{
*
eq_ref
=
new
Item_int
(
1
);
eq
->
arguments
()[
0
]
=
new
Item_int
(
1
);
eq
->
arguments
()[
1
]
=
new
Item_int
(
1
);
}
else
else
{
{
*
eq_ref
=
new
Item_func_isnotnull
(
*
eq_ref
=
new
Item_func_isnotnull
(
...
...
sql/rpl_parallel.cc
View file @
3cb82b62
...
@@ -1495,7 +1495,6 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
...
@@ -1495,7 +1495,6 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
}
}
else
if
(
!
is_group_event
)
else
if
(
!
is_group_event
)
{
{
my_off_t
log_pos
;
int
err
;
int
err
;
bool
tmp
;
bool
tmp
;
/*
/*
...
@@ -1509,7 +1508,13 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
...
@@ -1509,7 +1508,13 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
serial_rgi
->
is_parallel_exec
=
true
;
serial_rgi
->
is_parallel_exec
=
true
;
err
=
rpt_handle_event
(
qev
,
NULL
);
err
=
rpt_handle_event
(
qev
,
NULL
);
serial_rgi
->
is_parallel_exec
=
tmp
;
serial_rgi
->
is_parallel_exec
=
tmp
;
log_pos
=
ev
->
log_pos
;
if
(
ev
->
is_relay_log_event
())
qev
->
future_event_master_log_pos
=
0
;
else
if
(
typ
==
ROTATE_EVENT
)
qev
->
future_event_master_log_pos
=
(
static_cast
<
Rotate_log_event
*>
(
ev
))
->
pos
;
else
qev
->
future_event_master_log_pos
=
ev
->
log_pos
;
delete_or_keep_event_post_apply
(
serial_rgi
,
typ
,
ev
);
delete_or_keep_event_post_apply
(
serial_rgi
,
typ
,
ev
);
if
(
err
)
if
(
err
)
...
@@ -1532,7 +1537,6 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
...
@@ -1532,7 +1537,6 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
the current point.
the current point.
*/
*/
qev
->
ev
=
NULL
;
qev
->
ev
=
NULL
;
qev
->
future_event_master_log_pos
=
log_pos
;
}
}
else
else
{
{
...
...
sql/slave.cc
View file @
3cb82b62
...
@@ -318,7 +318,7 @@ handle_slave_init(void *arg __attribute__((unused)))
...
@@ -318,7 +318,7 @@ handle_slave_init(void *arg __attribute__((unused)))
mysql_mutex_lock
(
&
LOCK_thread_count
);
mysql_mutex_lock
(
&
LOCK_thread_count
);
slave_init_thread_running
=
false
;
slave_init_thread_running
=
false
;
mysql_cond_
signal
(
&
COND_thread_count
);
mysql_cond_
broadcast
(
&
COND_thread_count
);
mysql_mutex_unlock
(
&
LOCK_thread_count
);
mysql_mutex_unlock
(
&
LOCK_thread_count
);
return
0
;
return
0
;
...
...
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