Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem starting mysql replication with database with stored procedure

Status
Not open for further replies.

csgonan

MIS
May 2, 2007
118
US
Has anyone experienced this problem please? I am experiencing the same problem with mysql, no matter if it is database server 5.1.57 or community server 5.5.12 on Sparc Solaris 10.

Thanks in advance.

When I start replication, after a few minutes I receive the error

Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' on query. Default database: 'V2DB'. Query: 'UPDATE Users SET IsForgotPassword = NAME_CONST('InValue','

Research said there was a bug (and a said a workaround was to change the BIT value to INT. This would take a lot of work since it is used a lot though-out the application.

Research also showed a patch ( I could apply but it fails every time with this

# /usr/local/bin/patch -p0 < ../NameConstantPatch.txt

patching file b/mysql-test/r/func_misc.result Hunk #1 FAILED at 225.
1 out of 1 hunk FAILED -- saving rejects to file b/mysql-test/r/func_misc.result.rej
patching file b/mysql-test/t/func_misc.test Hunk #1 FAILED at 237.
1 out of 1 hunk FAILED -- saving rejects to file b/mysql-test/t/func_misc.test.rej patching file b/sql/item.cc Hunk #1 FAILED at 1240.
1 out of 1 hunk FAILED -- saving rejects to file b/sql/item.cc.rej #

When I looked into the files that are being patched it seems the versions already have the code incorporate. Has anyone experienced this issue and how did they resolve it? Am I doing something wrong too? The patch is in the top level of the mysql_### release.

Here is the patch
# more MysqlPatch
--- mysql-test/r/func_misc.result 2008-01-23 19:01:27 +04:00
+++ mysql-test/r/func_misc.result 2008-02-19 18:16:15 +04:00
@@ -225,4 +225,7 @@ select min(a) from t1 group by inet_ntoa
min(a)
-2
drop table t1;
+SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
+NAME_CONST('var', 'value') COLLATE latin1_general_cs value
End of 5.0 tests

--- mysql-test/t/func_misc.test 2008-01-23 19:01:27 +04:00
+++ mysql-test/t/func_misc.test 2008-02-19 18:16:15 +04:00
@@ -237,5 +237,11 @@ insert into t1 values (-1), (-2); select min(a) from t1 group by inet_ntoa(a); drop table t1;

+#
+# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures
breaks
+# replication
+#
+SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
+
--echo End of 5.0 tests

--- sql/item.cc 2008-02-08 14:55:54 +04:00
+++ sql/item.cc 2008-02-19 18:16:15 +04:00
@@ -1240,6 +1240,7 @@ bool Item_name_const::fix_fields(THD *th
return TRUE;
}
set_name(item_name->ptr(), (uint) item_name->length(), system_charset_info);
+ collation.set(value_item->collation.collation,
DERIVATION_IMPLICIT);
max_length= value_item->max_length;
decimals= value_item->decimals;
fixed= 1;
#
 
I tried a new patch command syntax and receive the same error.

# /usr/local/bin/patch -i ../MysqlPatch
patching file func_misc.result_a
Hunk #1 FAILED at 225.
1 out of 1 hunk FAILED -- saving rejects to file func_misc.result_a.rej
patching file func_misc.test_a
Hunk #1 FAILED at 237.
1 out of 1 hunk FAILED -- saving rejects to file func_misc.test_a.rej
patching file item.cc_a
Hunk #1 FAILED at 1240.
1 out of 1 hunk FAILED -- saving rejects to file item.cc_a.rej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top