Skip to content

Commit c341a2e

Browse files
author
Tor Didriksen
committed
Bug#22710312 VALGRIND: CONDITIONAL JUMP OR MOVE IN REWRITER::DO_REFRESH
Problem: valgrind warnings when loading the rewrite plugin, and there is no query_rewrite database. Fix: init m_table_is_malformed to true, in case of early return from Cursor CTOR
1 parent 1775f1d commit c341a2e

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Loads the plugin when there is no query_rewrite database
3+
#
4+
SET sql_mode = 'PIPES_AS_CONCAT';
5+
Warnings:
6+
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
7+
CALL mtr.add_suppression("Plugin rewriter reported: " ||
8+
"'Wrong column count or names when loading rules.'");
9+
INSTALL PLUGIN rewriter SONAME 'rewriter.xxx';
10+
UNINSTALL PLUGIN rewriter;
11+
Warnings:
12+
Warning 1620 Plugin is busy and will be uninstalled on shutdown
13+
SET sql_mode = DEFAULT;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--no-console
2+
--log-error=$MYSQL_TMP_DIR/errors.err
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--echo #
2+
--echo # Loads the plugin when there is no query_rewrite database
3+
--echo #
4+
5+
--source suite/query_rewrite_plugins/include/have_plugin_rewriter.inc
6+
7+
SET sql_mode = 'PIPES_AS_CONCAT';
8+
CALL mtr.add_suppression("Plugin rewriter reported: " ||
9+
"'Wrong column count or names when loading rules.'");
10+
11+
--replace_regex /\.so|\.dll/.xxx/
12+
eval INSTALL PLUGIN rewriter SONAME '$REWRITER';
13+
UNINSTALL PLUGIN rewriter;
14+
SET sql_mode = DEFAULT;

sql/rules_table_service.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -62,7 +62,8 @@ static void add_column(MY_BITMAP *map, Cursor::column_id column)
6262
Cursor::Cursor(MYSQL_THD mysql_thd) :
6363
m_thd(mysql_thd),
6464
m_table_list(NULL),
65-
m_is_finished(true)
65+
m_is_finished(true),
66+
m_table_is_malformed(true)
6667
{
6768
m_table_list= new TABLE_LIST;
6869
if (m_table_list == NULL)

0 commit comments

Comments
 (0)