Vladimir Espinosa Angarica <[EMAIL PROTECTED]> wrote: > > I've found a bug in the example presented in the Official MySQL > Manual in the section 9.1.15.6 A Simple Embedded Server Example. I tried > to compile the program following the instructions depicted in the manual > and a compiling error arose. The error was: > > gcc -g -W -Wall -I/usr/local/mysql/include -D_THREAD_SAFE > -D_REENTRANT -c -o test_libmysqld.o test_libmysqld.c > test_libmysqld.c: In function `db_do_query': > test_libmysqld.c:125: `res' undeclared (first use in this function) > test_libmysqld.c:125: (Each undeclared identifier is reported only once > test_libmysqld.c:125: for each function it appears in.) > make: *** [test_libmysqld.o] Error 1 > > I came back to the program and I realized that in the function > db_do_query the variable res was declared within the if block, so it's > out of scope when it is called in the statement: line 125: > mysql_free_result(res); > A simple movement of the declaration line to the beginning of the > function solve the problem. >
Thank you for the report. Fixed. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]