Forced TRADITIONAL mode to database connections.
authorMarco Zanon <info@marcozanon.com>
Sun, 11 Nov 2018 13:28:42 +0000 (13:28 +0000)
committerMarco Zanon <info@marcozanon.com>
Sun, 11 Nov 2018 13:28:42 +0000 (13:28 +0000)
6.x/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java

index c8f102ae6c18b244a900ed3f3d4cc1159b543fdb..9e5e2c2d901c60f1b63011cae92e43a45a7123e4 100644 (file)
@@ -84,13 +84,13 @@ public class MDatabaseConnection extends MObject {
         catch (SQLException exception) {
             throw new MDatabaseConnectionFailureException("Could not get database connection.", exception);
         }
-        // Set SQL mode to standard ANSI.
+        // Set SQL mode to standard ANSI and TRADITIONAL.
         try {
-            this.getConnection().createStatement().executeUpdate("SET SQL_MODE='ANSI'");
-            this.logStatement("### SET SQL_MODE='ANSI' ###");
+            this.getConnection().createStatement().executeUpdate("SET SQL_MODE='ANSI,TRADITIONAL'");
+            this.logStatement("### SET SQL_MODE='ANSI,TRADITIONAL' ###");
         }
         catch (SQLException exception) {
-            throw new MDatabaseConnectionFailureException("Could not set SQL mode to ANSI.", exception);
+            throw new MDatabaseConnectionFailureException("Could not set SQL mode to ANSI and TRADITIONAL.", exception);
         }
     }