When upgrading a site for customer to a new server with MySQL 5 instead of MySQL 4, I ran into the usual bunch of problems when migrating the database, some of which simply make mysql complain about the SQL dump (those were the easiest to fix) while others required a few changes in the ASP code. Like using commas instead of JOIN
s isn't always viable in MySQL 5.
One problem is more annoying though. With MySQL 5, most ASP statements dealing with comparisons now fail with a Type Mismatch
, such as :
IF RS("myfield") > 5 THEN
That especially happens if the SQL query involves SUM
s. It works fine with MySQL 4.
The fix is not difficult: For the queries, a CAST
to SIGNED
fixes it, and for the comparison statements themselves, using Cint
does the trick.
The problem is though, the site is huge and consists of hundreds of separate ASP files (the code is really bad!) and it is almost impossible to hunt down all these Type Mismatch
errors until they show up.
So my question is:
Is there a more global way to fix this problem? I think of settings in the ODDC driver or MySQL itself etc.