summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/Makefile.am24
-rw-r--r--libmysqld/lib_sql.cc14
2 files changed, 28 insertions, 10 deletions
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index e121e4b8d6e..9582084ba5d 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -25,9 +25,11 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
-INCLUDES= @MT_INCLUDES@ @bdb_includes@ \
+INCLUDES= @MT_INCLUDES@ @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \
-I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/regex \
+ -I$(top_builddir)/sql -I$(top_srcdir)/sql \
+ -I$(top_srcdir)/sql/examples \
+ -I$(top_srcdir)/regex \
$(openssl_includes) @ZLIB_INCLUDES@
noinst_LIBRARIES = libmysqld_int.a
@@ -118,16 +120,28 @@ endif
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
-# This is called from the toplevel makefile
+# This is called from the toplevel makefile. If we can link now
+# to an existing file in source, we do that, else we assume it
+# will show up in the build tree eventually (generated file).
link_sources:
set -x; \
for f in $(sqlsources); do \
rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
+ if test -e $(top_srcdir)/sql/$$f ; \
+ then \
+ @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
+ else \
+ @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
+ fi ; \
done; \
for f in $(libmysqlsources); do \
rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
+ if test -e $(top_srcdir)/libmysql/$$f ; \
+ then \
+ @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
+ else \
+ @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
+ fi ; \
done; \
for f in $(sqlexamplessources); do \
rm -f $$f; \
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index b8d890991df..7f9e2cced9e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -224,20 +224,24 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
{
DBUG_ENTER("emb_stmt_execute");
char header[4];
+ my_bool res;
+
int4store(header, stmt->stmt_id);
THD *thd= (THD*)stmt->mysql->thd;
thd->client_param_count= stmt->param_count;
thd->client_params= stmt->params;
- if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0,
- header, sizeof(header), 1, stmt) ||
- emb_mysql_read_query_result(stmt->mysql))
+
+ res= test(emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0,
+ header, sizeof(header), 1, stmt) ||
+ emb_mysql_read_query_result(stmt->mysql));
+ stmt->affected_rows= stmt->mysql->affected_rows;
+ stmt->insert_id= stmt->mysql->insert_id;
+ if (res)
{
NET *net= &stmt->mysql->net;
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
DBUG_RETURN(1);
}
- stmt->affected_rows= stmt->mysql->affected_rows;
- stmt->insert_id= stmt->mysql->insert_id;
DBUG_RETURN(0);
}