Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Unavailable - Error No. [0x01F4] -> return "FROM_UNIXTIME($timestamp)"; #1753

Closed
rcubetrac opened this issue Sep 10, 2008 · 3 comments

Comments

@rcubetrac
Copy link

commented Sep 10, 2008

Reported by Makc666 on 10 Sep 2008 07:16 UTC as Trac ticket #1485332

'Service Unavailable - Error No. [say:

[Tue Sep 9 13:40:42 2008](0x01F4]'''

''Logs) [PHP Notice: _doQuery: [Error message: Could not execute statement](error])\n[executed query: PREPARE MDB2_STATEMENT_mysql_e6b07f044db4874a5a1a9d9fb1e64 d4ce9b805cd7 FROM 'INSERT INTO messages\\n (user_id, del, cache_key, created, idx, uid, subject, `from`, `to`, cc, date, size, headers, structure)\\n VALUES (?, 0, ?, now(), ?, ?, ?, ?, ?, ?, FROM_UNIXTIME(), ?, ?, ?)'](Last)\n[code: 1064](Native)\n[message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), ?, ?, ?)' at line 3](Native)\n in /www/program/include/bugs.inc on line 95

Found out how to fix for 0.1.1

Really there is a bug (a misprint in coding)...

File:
program/include/rcube_mdb2.inc

Code:

  function fromunixtime($timestamp)
    {
    switch($this->db_provider)
      {
      case 'mysqli':
      case 'mysql':
      case 'sqlite':
        return "FROM_UNIXTIME($timestamp)";

      default:
        return date("'Y-m-d H:i:s'", $timestamp);
      }
    }

Problem line:

return "FROM_UNIXTIME($timestamp)";

Must be:

return sprintf("FROM_UNIXTIME(%d)", $timestamp);

Saying the truth if we look into file:
program/include/rcube_db.inc

We will see that there is the same function there:

function fromunixtime($timestamp)
    {
    switch($this->db_provider)
      {
      case 'mysqli':
      case 'mysql':
      case 'sqlite':
        return sprintf("FROM_UNIXTIME(%d)", $timestamp);

      default:
        return date("'Y-m-d H:i:s'", $timestamp);
      }
    }

But as you can see the "problem" line like in previous function is OK.

return sprintf("FROM_UNIXTIME(%d)", $timestamp);

Keywords: Service Unavailable 0x01F4
Migrated-From: http://trac.roundcube.net/ticket/1485332

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Sep 10, 2008

Comment by Makc666 on 10 Sep 2008 07:24 UTC

Discussion thread in forums
[http://www.roundcubeforum.net/showthread.php?t=3234]

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Sep 10, 2008

Comment by @alecpl on 10 Sep 2008 08:13 UTC

http://trac.roundcube.net/wiki/Howto_ReportIssues. I was fixed, please check svn-trunk version before requesting a bug.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Sep 10, 2008

Status changed by @alecpl on 10 Sep 2008 08:13 UTC

new => closed

@rcubetrac rcubetrac closed this Sep 10, 2008

@rcubetrac rcubetrac added this to the 0.2-beta milestone Mar 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.