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
4891d514
Commit
4891d514
authored
May 06, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16095 Oracle-style placeholder inside GROUP BY..WITH ROLLUP breaks replication
parent
b20039dd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
11 deletions
+65
-11
mysql-test/suite/compat/oracle/r/binlog_stm_ps.result
mysql-test/suite/compat/oracle/r/binlog_stm_ps.result
+31
-0
mysql-test/suite/compat/oracle/t/binlog_stm_ps.test
mysql-test/suite/compat/oracle/t/binlog_stm_ps.test
+20
-0
sql/sql_lex.cc
sql/sql_lex.cc
+8
-5
sql/sql_lex.h
sql/sql_lex.h
+2
-2
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+4
-4
No files found.
mysql-test/suite/compat/oracle/r/binlog_stm_ps.result
View file @
4891d514
...
...
@@ -65,3 +65,34 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (10,20)
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
#
# MDEV-16095 Oracle-style placeholder inside GROUP BY..WITH ROLLUP breaks replication
#
FLUSH LOGS;
CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
CREATE TABLE t2 (d DATE, c BIGINT);
BEGIN
EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param' USING 1;
EXECUTE IMMEDIATE 'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param WITH ROLLUP' USING 1;
END;
$$
DROP TABLE t1,t2;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; CREATE TABLE t1 (d DATE)
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24')
master-bin.000002 # Query # # COMMIT
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; CREATE TABLE t2 (d DATE, c BIGINT)
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, 1
master-bin.000002 # Query # # COMMIT
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `test`; INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, 1 WITH ROLLUP
master-bin.000002 # Query # # COMMIT
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; DROP TABLE "t1","t2" /* generated by server */
mysql-test/suite/compat/oracle/t/binlog_stm_ps.test
View file @
4891d514
...
...
@@ -35,3 +35,23 @@ SELECT * FROM t1;
--
let
$binlog_file
=
LAST
source
include
/
show_binlog_events
.
inc
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-16095 Oracle-style placeholder inside GROUP BY..WITH ROLLUP breaks replication
--
echo
#
FLUSH
LOGS
;
CREATE
TABLE
t1
(
d
DATE
);
INSERT
INTO
t1
VALUES
(
'1985-05-13'
),(
'1989-12-24'
);
CREATE
TABLE
t2
(
d
DATE
,
c
BIGINT
);
DELIMITER
$$
;
BEGIN
EXECUTE
IMMEDIATE
'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param'
USING
1
;
EXECUTE
IMMEDIATE
'INSERT INTO t2 SELECT d, COUNT(*) FROM t1 GROUP BY d, :param WITH ROLLUP'
USING
1
;
END
;
$$
DELIMITER
;
$$
DROP
TABLE
t1
,
t2
;
--
let
$binlog_file
=
LAST
source
include
/
show_binlog_events
.
inc
;
sql/sql_lex.cc
View file @
4891d514
...
...
@@ -6600,16 +6600,19 @@ Item *LEX::create_and_link_Item_trigger_field(THD *thd,
Item
*
LEX
::
make_item_colon_ident_ident
(
THD
*
thd
,
const
Lex_ident_
sys_st
*
a
,
const
Lex_ident_
sys_st
*
b
)
const
Lex_ident_
cli_st
*
c
a
,
const
Lex_ident_
cli_st
*
c
b
)
{
if
(
!
is_trigger_new_or_old_reference
(
a
))
Lex_ident_sys
a
(
thd
,
ca
),
b
(
thd
,
cb
);
if
(
a
.
is_null
()
||
b
.
is_null
())
return
NULL
;
// OEM
if
(
!
is_trigger_new_or_old_reference
(
&
a
))
{
thd
->
parse_error
();
return
NULL
;
}
bool
new_row
=
(
a
->
str
[
0
]
==
'N'
||
a
->
str
[
0
]
==
'n'
);
return
create_and_link_Item_trigger_field
(
thd
,
b
,
new_row
);
bool
new_row
=
(
a
.
str
[
0
]
==
'N'
||
a
.
str
[
0
]
==
'n'
);
return
create_and_link_Item_trigger_field
(
thd
,
&
b
,
new_row
);
}
...
...
sql/sql_lex.h
View file @
4891d514
...
...
@@ -3577,8 +3577,8 @@ struct LEX: public Query_tables_list
bool
new_row
);
// For syntax with colon, e.g. :NEW.a or :OLD.a
Item
*
make_item_colon_ident_ident
(
THD
*
thd
,
const
Lex_ident_
sys
_st
*
a
,
const
Lex_ident_
sys
_st
*
b
);
const
Lex_ident_
cli
_st
*
a
,
const
Lex_ident_
cli
_st
*
b
);
void
sp_block_init
(
THD
*
thd
,
const
LEX_CSTRING
*
label
);
void
sp_block_init
(
THD
*
thd
)
{
...
...
sql/sql_yacc_ora.yy
View file @
4891d514
...
...
@@ -14415,10 +14415,10 @@ param_marker:
YYLIP->get_tok_start() + 1)))
MYSQL_YYABORT;
}
| colon_with_pos ident
| colon_with_pos ident
_cli
{
if (!($$= Lex->add_placeholder(thd, &null_clex_str,
$1,
YYLIP->get_tok_
end())))
$1,
$2.
end())))
MYSQL_YYABORT;
}
| colon_with_pos NUM
...
...
@@ -14727,7 +14727,7 @@ simple_ident:
if (!($$= Lex->create_item_ident(thd, &$1, &$3, &$5)))
MYSQL_YYABORT;
}
| colon_with_pos ident
'.' ident
| colon_with_pos ident
_cli '.' ident_cli
{
if (!($$= Lex->make_item_colon_ident_ident(thd, &$2, &$4)))
MYSQL_YYABORT;
...
...
@@ -14745,7 +14745,7 @@ simple_ident_nospvar:
if (!($$= Lex->create_item_ident_nospvar(thd, &$1, &$3)))
MYSQL_YYABORT;
}
| colon_with_pos ident
'.' ident
| colon_with_pos ident
_cli '.' ident_cli
{
if (!($$= Lex->make_item_colon_ident_ident(thd, &$2, &$4)))
MYSQL_YYABORT;
...
...
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