I've got a database which hasn't been very well designed. For example, there are DATETIME fields (not null) which have values like 0000-00-00 00:00:00.

I want to turn on STRICT_TRANS_TABLES mode. The database functions but the apps often fail with broken queries (often INSERT/UDPATE)

Are there any tools to recommend what should be fixed by looking at the data in tables & structure?

Specifically looking for:

  • Built in warnings (if any?)
  • Asking the mysql server if it thinks there is anything wrong with the structure & table data

1 Answer 1

  • There are few, if any, tools are available.
  • You really must study the code enough to understand it, before thinking about automated fixes.
  • You can probably study each problem in depth and fix it before moving on. For example, changing 0 dates to NULLs is probably an ALTER plus an UPDATE. But then the code needs changing to test for NULL instead of 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.