List:General Discussion« Previous MessageNext Message »
From:walter harms Date:May 8 2009 12:03pm
Subject:Re: Memory corrupting, while retrive the query generated
View as plain text  

Ravi raj schrieb:
> Dear walter Harms,
> 
>              Thanks for your valuable solution, but in the code which
> you provided is printing only one row , if i try to print whole table, 
> or 2, or 3, columns fully means its giving segmentation fault, kindly
> check the below code for furthur information.
> 
> software used:
> ---------------
> 1. MYSQL 6.0.0
> 2.MySQL Connection C 6.0
> 3.Cygwin (used to run the programs using GCC)
> 
> Operating Systems:
> --------------------
> Windows Vista Home basic
> 
> building executable:
> --------------------------
> exporting c connection library (mysql.h) as,
> export PATH=$PATH:"c:/Program Files/MySQL/MySQL Connection C 6.0/lib/opt"
> 
> and i copied the  " libmysql.dll "   to local folder where the c code
> resides,
> 
> 
> gcc -g -c simple.c
> gcc -g libmysql.dll simple.o
> 
> running:
> ------------
> ./a.exe
> 
> 
> 
> if i run the below code its giving output like this ,(trying to get all
> values from a particular column of a table).
> 
>
> ---------------------------------------####----output-----####-------------------------------------------------------
> 
> num_fields = 2
> 127.0.0.1
> 
> localhost
>     28 [main] a 3836 _cygtls::handle_exceptions: Error while dumping
> state (probably corrupted stack)
> Segmentation fault (core dumped)
>
> ------------------------------------------------------------------------------------------------------------------------


hi Ravi,
i have checked your programm on my box and it works as expected.
(linux,mysql 5.0)

That leaves only your environment  (compiler,libraries,...) as culprit.
The most easy think to do now is to install a linux and give it a try.

re,
 wh

Thread
Memory corrupting, while retrive the query generatedRavi raj7 May
  • Re: Memory corrupting, while retrive the query generatedwalter harms7 May
    • Re: Memory corrupting, while retrive the query generatedRavi raj8 May
      • Re: Memory corrupting, while retrive the query generatedwalter harms8 May