Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl DBD-Mysql results in corrupted values when using prepared statements
    primarykey
    data
    text
    <p>I'm getting the following error during random replaces:</p> <p><strong>DBD::mysql::st execute failed: Incorrect integer value: 'ð' for column 'sequence' at row 1</strong></p> <p>I get this error when running many queries in a row. It does not always happen on the same line, and this error not always exactly the same. It is USUALLY "Incorrect integer value" or "Incorrect decimal value", and the value in quotes always changes and shows some random character or set of characters.</p> <p>Here is the statement as generated by my code:</p> <pre><code>REPLACE INTO site SET id = ? ,sequence = ? ,sitenumber = ? ,startdate = ? ,enddate = ? ,damages = ? ,typedays = ? ,description = ? </code></pre> <p>Data::Dumper shows the following when I dump the parameters being passed in:</p> <pre><code>print Dumper(@params); $VAR1 = '300'; $VAR2 = '1'; $VAR3 = '0'; $VAR4 = undef; $VAR5 = '2012-03-09'; $VAR6 = '130'; $VAR7 = undef; $VAR8 = 'COMPOSITE'; </code></pre> <p>Of course these values are different depending on which query failed. They are always valid data though, and the actual SQL query runs correctly in a console.</p> <p>Relevant code as follows</p> <pre><code>$db-&gt;{sth} = $dbh-&gt;prepare_cached($sql, { dbi_dummy =&gt; __FILE__.__LINE__ }, 3); $db-&gt;{sth}-&gt;execute(@params) ; </code></pre> <p>Replacing the first line as follows prevents the error, but our application would gain quite a bit from the caching.</p> <pre><code>$db-&gt;{sth} = $dbh-&gt;prepare($sql, { dbi_dummy =&gt; __FILE__.__LINE__ }); </code></pre> <p>Any Ideas?</p> <p>Additional information requested:</p> <blockquote> <p>$ mysql -V mysql Ver 14.14 Distrib 5.1.61, for redhat-linux-gnu (x86_64) using readline 5.1</p> <p>$ cat /etc/*-release CentOS release 6.3 (Final)</p> <p>DBD::mysql.pm version 4.013</p> <p>$ perl -v</p> <p>This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload