At 17:23 -0800 1/9/02, Kyle Hayes wrote:
>I am putting the finishing touches on a completely reworked replication
>server/client scheme (we cannot use MySQL's native replication for what we
>are doing). The whole thing is written in Perl/DBI and runs
>on Linux (x86). We are using various versions of MySQL, but all 3.23.x
>series. We are slowly upgrading to the latest version 3.23.47.
>I don't know the version of the MySQL Perl DBI libraries we use, but they
>are not too old. We have mixed Red Hat and SuSE systems.
>The program works by getting the contents of the update log and using the
>Perl DBI do() function on each statement.
>The problem that occurs causes this (debug output):
> SQL: use acc;
> DBD::mysql::db do failed: You have an error in your SQL syntax near ';
> ' at line 1 at /opt/bin/replicator_client line 199, <GEN2> line 4.
>I have found that this works _IFF_ I strip off the trailing linefeed after
>the semicolon at the end of the statement. I could swear that we create
>SQL statement in Perl "here docs" that end with a semicolon and several
>empty lines. Is there a DBI guru that can tell me what is going on? I
>really notice this especially in "USE" statements...
Don't add the semicolon. That's for when you use the mysql client,
which you aren't doing.
The error message is complaining about the semicolon, by the way,
not the linefeed.
>Anyone have an idea? I haven't found anything particularly relevent in
>the mailing list archives.