Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv13596
Modified Files:
serendipity_functions.inc.php
Log Message:
Replaced now() with CURRENT_DATE in track_url() function. This is necessary
because under postgresq, the update was not touching anything. now() returns
a timestamp data type, and the 'day' field is a DATE type. Instead of casting
now() to a DATE, it was casting 'day' to a timestamp before executing the WHERE
clause. CURRENT_DATE is valid under postgresql and mysql.
See http://www.mysql.com/doc/en/Date_and_time_functions.html and
http://www.postgresql.org/docs/7.3/interactive/datatype-datetime.html
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- serendipity_functions.inc.php 20 Jan 2004 11:37:15 -0000 1.179
+++ serendipity_functions.inc.php 21 Jan 2004 07:31:03 -0000 1.180
@@ -2302,7 +2302,7 @@
AND port = '%s'
AND path = '%s'
AND query = '%s'
- AND day = NOW()
+ AND day = CURRENT_DATE
%s",
$serendipity['dbPrefix'] . $list,
@@ -2320,7 +2320,7 @@
sprintf(
"INSERT INTO %s
(day, count, scheme, host, port, path, query%s)
- VALUES ( NOW(), 1, '%s', '%s', '%s', '%s', '%s'%s)",
+ VALUES ( CURRENT_DATE, 1, '%s', '%s', '%s', '%s', '%s'%s)",
$serendipity['dbPrefix'] . $list,
($entry_id != 0) ? ', entry_id' : '',
$url_parts['scheme'],
@@ -2598,4 +2598,4 @@
define("serendipity_FUNCTIONS_LOADED", true);
/* vim: set sts=4 ts=4 expandtab : */
-?>
\ No newline at end of file
+?>
|