2

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 JOINs 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 SUMs. 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.

marlar
  • 3,858
  • 6
  • 37
  • 60

1 Answers1

0

Doing the change in the DB instead of the asp code could be a way to go. That way you dont have to change that many webpages. The question is if these fields are possible to change for your needs?

Did you also change database type? InnoDB or MyISAM, that could also change the way field are handled?

Sourcery
  • 641
  • 1
  • 5
  • 15
  • It was not possible to change the fields because that could break other parts of the code. But I have corrected these errors by now as they showed up and there has not been any for a while. The DB type was not changed. – marlar Jun 26 '14 at 11:36