473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MySQL embedded server example bug

Hi Team:

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.

Regards

Vladimir

--
BSc. Vladimir Espinosa Angarica
Researcher
National Bioinformatics Center
Ministry of Science Technology and the Environment
Industria y San José, Habana Vieja
Capitolio Nacional
CUBA
Fax: (53-7) 8609614
Tel: (53-7) 8604397
E-mail: ve*******@bioinfo.cu

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1538

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: quadric | last post by:
Hi, I have an application that has an embedded/extended Python interpreter. I need to add database capabilities and for reasons to lengthy to explain in this email, also require an embedded...
3
by: hshen | last post by:
Hi All, I have encountered a weird behavoir of embedded MySQL. Through a simple program I made (in Delphi 6), I can insert rows to a table through embedded MySQL and I can retrieve the rows from...
0
by: Vladimir Espinosa Angarica | last post by:
I've installed the last stable MySQL version (4.0.14-standard) under Linux, (Suse-8.0) kernel 2.4.28-64GB SMP, form the binary distribution that i downloaded from www.mysql.com. I'm interested on...
0
by: Vladimir Espinosa Angarica | last post by:
Hi Team: 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...
0
by: Bill Davidson | last post by:
Hello: I have a thin C++ database access library that can be used with MySQL *only* through MyODBC. I would like to use this database access library with embedded mySQL server. Would that be...
1
by: ikrabbe | last post by:
Hi, I want to set up a mysql server in an embedded process. I managed to start the server in my program as described through mysql_server_init() Now I need a client connection to this...
2
by: Currie | last post by:
Does mySQL have lite version? Similar to ms sql express, where it can be distributed without a full server version. I have program with many clients and i'm wanting to move away from access if i...
7
by: Randy | last post by:
Folks: We have a web-based app that's _really_ slowing down because multiple clients are writing their own private data into a single, central database. I guess the previous programmer did...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.