Bug #20858 | Mysql client application crashes while calling mysql_real_query | ||
---|---|---|---|
Submitted: | 5 Jul 2006 4:39 | Modified: | 5 Aug 2006 12:43 |
Reporter: | Renuka R | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.20 | OS: | Soalris |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[5 Jul 2006 4:39]
Renuka R
[5 Jul 2006 8:51]
Sveta Smirnova
I can't crash my application with mysql_real_query using mysql-4.1.21 libraries compiled with Sun Studio. Could you please provide code which can do it? To attach files click "Files" tab above bug description.
[5 Jul 2006 9:19]
Renuka R
my client program is #include <stdlib.h> #include "/usr/local/mysql/include/mysql/mysql.h" #include <stdio.h> int main(){ MYSQL *mysql, obj_mysql; MYSQL_RES *res; MYSQL_ROW row; char *query,*fip; int t,r; void **p_p_mysql_recv; p_p_mysql_recv = (void**)malloc(sizeof(char*)); mysql = (MYSQL *)*p_p_mysql_recv; *p_p_mysql_recv = NULL; *p_p_mysql_recv = (void*)malloc(sizeof(MYSQL)); //(MYSQL*)malloc(sizeof(MYSQL)); //mysql = &obj_mysql; //if( NULL == mysql_init(mysql)) if (NULL == mysql_init((MYSQL *)*p_p_mysql_recv)) { printf("mysql pointer is null \n "); } else printf("mysql pointer is NOT null \n "); //if (!mysql_real_connect(mysql,"127.0.0.1","oam","oam","OAM_LIData",32478,"/tmp/oam_renu_comp.sock",0)) if (!mysql_real_connect((MYSQL *)*p_p_mysql_recv,"127.0.0.1","oam","oam","OAM_LIData",32478,"/tmp/oam_renu_comp.sock",0)) { fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error((MYSQL *)*p_p_mysql_recv)); } else printf("Connected...\n"); query="select * from OAM_DF_INFO"; //t=mysql_real_query(mysql,query,(unsigned int) strlen(query)); t=mysql_real_query((MYSQL *)*p_p_mysql_recv,query,(unsigned int) strlen(query)); if (t) { printf("Error making query: %s\n", //mysql_error(mysql)); mysql_error((MYSQL *)*p_p_mysql_recv)); } else printf("Query made...\n"); res=mysql_use_result((MYSQL *)*p_p_mysql_recv); /* for(r=0;r<=mysql_field_count(mysql);r++){ row=mysql_fetch_row(res); if(!row) break; for(t=0;t<mysql_num_fields(res);t++){ if(row[t]) printf("%s ",row[t]); } printf("\n"); }*/ //printf("The existing sock fd is %d\n",mysql->NET.fd); fip="172.31.118.245"; printf("Existing fip is %s\n",fip); //OAM_bind_fip(mysql,fip); //printf("The CGHANGED sock fd is %d\n",mysql->NET.fd); mysql_close((MYSQL *)*p_p_mysql_recv); }
[5 Jul 2006 12:43]
Sveta Smirnova
I still can not repeat crash using your code and last sources. Which compiler do you use? What version of Solaris do you use?
[5 Aug 2006 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".