From cb5996ca37c6dabc5d9b44dba7c54ebcdefbf6b7 Mon Sep 17 00:00:00 2001
From: prasad <prasad@vtiger.com>
Date: Wed, 15 Jun 2016 14:10:40 +0530
Subject: [PATCH] Rolled back fix in adodb lib (as it failed to work with MySQL
 5.5.x). Adjusted schema to make it friendly to STRICT_TRANS_TABLE mode.

---
 libraries/adodb/adodb-datadict.inc.php | 3 ++-
 schema/DatabaseSchema.xml              | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libraries/adodb/adodb-datadict.inc.php b/libraries/adodb/adodb-datadict.inc.php
index 8b07e204..dbf12a5d 100644
--- a/libraries/adodb/adodb-datadict.inc.php
+++ b/libraries/adodb/adodb-datadict.inc.php
@@ -750,7 +750,8 @@ class ADODB_DataDict {
 			if ($fdefts) {
 				if (substr($this->connection->databaseType,0,5) == 'mysql') {
 					$ftype = 'TIMESTAMP';
-					$fdefault = ' CURRENT_TIMESTAMP'; /* STRICT_TRANS_TABLES fix */
+					// Fix works only for MySQL 5.6 (which allows one or more column to have default timestamp
+					// $fdefault = ' CURRENT_TIMESTAMP'; /* STRICT_TRANS_TABLES fix */
 				} else {
 					$fdefault = $this->connection->sysTimeStamp;
 				}
diff --git a/schema/DatabaseSchema.xml b/schema/DatabaseSchema.xml
index 08c0f29b..f9a3b22c 100644
--- a/schema/DatabaseSchema.xml
+++ b/schema/DatabaseSchema.xml
@@ -28,8 +28,11 @@
 			<deftimestamp />
 		</field>
 		<field name="date_modified" type="T">
+			<!-- Troublesome with STRICT_TRANS_TABLE mode depends on MySQL 5.5 or 5.6+ -->
+			<!--
 			<notnull />
 			<deftimestamp />
+			-->
 		</field>
 		<field name="modified_user_id" type="C" size="36" />
 		<field name="title" type="C" size="50" />
@@ -1780,8 +1783,11 @@
 			<deftimestamp />
 		</field>
 		<field name="date_modified" type="T">
+            <!-- Troublesome with STRICT_TRANS_TABLE mode depends on MySQL 5.5 or 5.6+ -->
+			<!--
 			<notnull />
 			<deftimestamp />
+			-->
 		</field>
 		<field name="assigned_user_id" type="C" size="36" />
 		<field name="is_published" type="C" size="3">
-- 
GitLab