Bug #46118 | SYSDATE() and NOW() return an innacurate time through C API | ||
---|---|---|---|
Submitted: | 10 Jul 2009 17:38 | Modified: | 10 Aug 2009 22:03 |
Reporter: | Jon Vance | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S2 (Serious) |
Version: | 5.0.77 | OS: | Windows (XP Pro) |
Assigned to: | CPU Architecture: | Any | |
Tags: | NOW(), SYSDATE() |
[10 Jul 2009 17:38]
Jon Vance
[10 Jul 2009 19:34]
Sveta Smirnova
Thank you for the report. Do you get same offset if connect to remote server using mysql command line client? Also, please, indicate accurate minor version of server and client libraries you are using.
[10 Jul 2009 20:14]
Sveta Smirnova
Thank you for the feedback. Please use function mysql_get_client_version() (http://dev.mysql.com/doc/refman/5.0/en/mysql-get-client-version.html)
[10 Jul 2009 20:19]
Jon Vance
Server version: 5.0.77 Client version: 60000
[10 Jul 2009 20:28]
Sveta Smirnova
Thank you for the feedback. Do you get same offset if connect to remote server using mysql command line client?
[10 Jul 2009 20:30]
Jon Vance
Sorry, I missed that question :) No, the command line client produces no offset.
[10 Jul 2009 21:57]
MySQL Verification Team
C api client and command line
Attachment: now.png (image/png, text), 61.33 KiB.
[10 Jul 2009 22:03]
MySQL Verification Team
Thank you for the feedback. I am not quite sure if I understood the bug which you are reporting. I created a C client as below: #include <my_global.h> #include <m_string.h> #include <mysql.h> #define DB_HOST "localhost" #define DB_USER "root" #define DB_PASSW "" #define DB_NAME "test" #define DB_PORT 3500 #define DB_UNIX_SOCKET NULL #define SELECT_QUERY "SELECT NOW()" int main( void ) { MYSQL mysql; MYSQL_RES *result; mysql_init( &mysql ); if ( !mysql_real_connect( &mysql,DB_HOST,DB_USER,DB_PASSW,DB_NAME,DB_PORT,DB_UNIX_SOCKET,CLIENT_MULTI_RESULTS ) ) { printf("Error: %s\n",mysql_error(&mysql)); return 0; } else printf("Server: %s Client: %s\n\n",mysql_get_server_info(&mysql),mysql_get_client_info()); if (mysql_query( &mysql, SELECT_QUERY) ) { printf("Error (query): %s\n", mysql_error( &mysql )); mysql_close( &mysql ); return 0; } result = mysql_use_result(&mysql); MYSQL_ROW row = mysql_fetch_row(result); printf("now: %s\n", row[0]); mysql_free_result(result); mysql_close(&mysql); return 1; } Then I launched the above client and the command line almost at the same time how showed in the prior attached picture. I used the mysql client tool -e option because the connection takes time so I think isn't a valid test to connect first the command line and then query. Thanks in advance.
[10 Aug 2009 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".