[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-developers] default timestamp values
From: |
Bradley Bell |
Subject: |
[Phpgroupware-developers] default timestamp values |
Date: |
Thu, 20 Dec 2001 15:24:36 -0800 |
User-agent: |
Mutt/1.2.5i |
The default for history_timestamp in history_log gets set to 'GetDate()' -
including the quotes, so it is interpreted as a string, and all attempts to
insert (without specifying the timestamp) fail.
I assume the same thing would happen in mysql and pgsql, where it gets set
to 'now' - including the quotes. This patch should fix it (for new
installs), by leaving the quotes up to the TranslateDefault function.
-brad
--
Bradley Bell
Computer Support Analyst
University of Washington
Classroom Support Services
Index: inc/class.schema_proc.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc.inc.php,v
retrieving revision 1.3
diff -u -r1.3 class.schema_proc.inc.php
--- inc/class.schema_proc.inc.php 2001/09/12 13:44:35 1.3
+++ inc/class.schema_proc.inc.php 2001/12/20 21:51:58
@@ -389,7 +389,7 @@
if ($DEBUG) { echo'<br>_GetFieldSQL():
Calling TranslateDefault for "' . $sDefault . '"'; }
// Get default DDL - useful for
differences in date defaults (eg, now() vs. getdate())
$sTranslatedDefault =
$this->m_oTranslator->TranslateDefault($sDefault);
- $sFieldSQL .= " DEFAULT
'$sTranslatedDefault'";
+ $sFieldSQL .= " DEFAULT
$sTranslatedDefault";
}
elseif($sDefault == '0')
{
Index: inc/class.schema_proc_array.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_array.inc.php,v
retrieving revision 1.1
diff -u -r1.1 class.schema_proc_array.inc.php
--- inc/class.schema_proc_array.inc.php 2001/07/30 15:59:25 1.1
+++ inc/class.schema_proc_array.inc.php 2001/12/20 21:51:58
@@ -29,7 +29,7 @@
function TranslateDefault($sDefault)
{
- return $sDefault;
+ return "'$sDefault'";
}
function GetPKSQL($sFields)
Index: inc/class.schema_proc_mssql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_mssql.inc.php,v
retrieving revision 1.1
diff -u -r1.1 class.schema_proc_mssql.inc.php
--- inc/class.schema_proc_mssql.inc.php 2001/07/30 15:59:25 1.1
+++ inc/class.schema_proc_mssql.inc.php 2001/12/20 21:51:58
@@ -110,7 +110,7 @@
return "GetDate()";
}
- return $sDefault;
+ return "'$sDefault'";
}
// Inverse of above, convert sql column types to array info
Index: inc/class.schema_proc_mysql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_mysql.inc.php,v
retrieving revision 1.5
diff -u -r1.5 class.schema_proc_mysql.inc.php
--- inc/class.schema_proc_mysql.inc.php 2001/10/18 01:02:49 1.5
+++ inc/class.schema_proc_mysql.inc.php 2001/12/20 21:51:59
@@ -112,7 +112,7 @@
return 'now';
}
- return $sDefault;
+ return "'$sDefault'";
}
// Inverse of above, convert sql column types to array info
Index: inc/class.schema_proc_pgsql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_pgsql.inc.php,v
retrieving revision 1.8
diff -u -r1.8 class.schema_proc_pgsql.inc.php
--- inc/class.schema_proc_pgsql.inc.php 2001/11/29 03:58:22 1.8
+++ inc/class.schema_proc_pgsql.inc.php 2001/12/20 21:51:59
@@ -102,7 +102,7 @@
return 'now';
}
- return $sDefault;
+ return "'$sDefault'";
}
// Inverse of above, convert sql column types to array info
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-developers] default timestamp values,
Bradley Bell <=