summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <tim@threads.polyesthetic.msg>2001-06-04 18:34:04 -0400
committerunknown <tim@threads.polyesthetic.msg>2001-06-04 18:34:04 -0400
commitbc0befda9cc4a26deac21cd59cfd96c8d3355edb (patch)
treed1a1e436c5691d8f33e00c6966b99fe986110ece /libmysqld
parent020160f83f62d6171c57a4021e21e68049c2a4e8 (diff)
downloadmariadb-git-bc0befda9cc4a26deac21cd59cfd96c8d3355edb.tar.gz
Various changes to get libmysqld in sync with latest sources.
BitKeeper/etc/ignore: Added libmysqld/uniques.cc client/mysqltest.c: Don't core dump if --socket isn't specified. Add --test-file option, to facilitate running mysqltest under debugger. libmysqld/Makefile.am: We need uniques.cc libmysqld/lib_sql.cc: Tiny cleanup. libmysqld/libmysqld.c: Split mysql_real_query() into mysql_send_query() and mysql_read_query_results().
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/Makefile.am4
-rw-r--r--libmysqld/lib_sql.cc4
-rw-r--r--libmysqld/libmysqld.c29
3 files changed, 26 insertions, 11 deletions
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 8d8ac3c9a21..fe8bcb4c4e4 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -54,7 +54,7 @@ sqlsources = convert.cc derror.cc field.cc field_conv.cc filesort.cc \
sql_rename.cc sql_repl.cc sql_select.cc sql_show.cc \
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
- unireg.cc
+ unireg.cc uniques.cc
## XXX: we should not have to duplicate info from the sources list
sqlobjects = convert.lo derror.lo field.lo field_conv.lo filesort.lo \
@@ -72,7 +72,7 @@ sqlobjects = convert.lo derror.lo field.lo field_conv.lo filesort.lo \
sql_rename.lo sql_repl.lo sql_select.lo sql_show.lo \
sql_string.lo sql_table.lo sql_test.lo sql_udf.lo \
sql_update.lo sql_yacc.lo table.lo thr_malloc.lo time.lo \
- unireg.lo
+ unireg.lo uniques.lo
EXTRA_DIST = lib_vio.c
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index b2889079ac8..ed04d85ee6e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -50,8 +50,8 @@ void free_defaults_internal(char ** argv){if (argv) free_defaults(argv);}
char mysql_data_home[FN_REFLEN];
char * get_mysql_data_home(){return mysql_data_home;};
#define mysql_data_home mysql_data_home_internal
-#include "../sql/mysqld.cc"
#include "lib_vio.c"
+#include "../sql/mysqld.cc"
#define SCRAMBLE_LENGTH 8
extern "C" {
@@ -600,7 +600,7 @@ void embedded_srv_init(void)
}
//printf(ER(ER_READY),my_progname,server_version,"");
- printf("%s initialized.\n", server_version);
+ //printf("%s initialized.\n", server_version);
fflush(stdout);
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index 732c102c640..fe429c4d54d 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -1323,22 +1323,26 @@ mysql_query(MYSQL *mysql, const char *query)
return mysql_real_query(mysql,query, (uint) strlen(query));
}
+int STDCALL
+mysql_send_query(MYSQL* mysql, const char* query, uint length)
+{
+ return simple_command(mysql, COM_QUERY, query, length, 1);
+}
+
int STDCALL
-mysql_real_query(MYSQL *mysql, const char *query, uint length)
+mysql_read_query_result(MYSQL *mysql)
{
uchar *pos;
ulong field_count;
MYSQL_DATA *fields;
- DBUG_ENTER("mysql_real_query");
- DBUG_PRINT("enter",("handle: %lx",mysql));
- DBUG_PRINT("query",("Query = \"%s\"",query));
+ uint length;
+ DBUG_ENTER("mysql_read_query_result");
- if (simple_command(mysql,COM_QUERY,query,length,1) ||
- (length=net_safe_read(mysql)) == packet_error)
+ if ((length=net_safe_read(mysql)) == packet_error)
DBUG_RETURN(-1);
free_old_query(mysql); /* Free old result */
- get_info:
+get_info:
pos=(uchar*) mysql->net.read_pos;
if ((field_count= net_field_length(&pos)) == 0)
{
@@ -1375,6 +1379,17 @@ mysql_real_query(MYSQL *mysql, const char *query, uint length)
DBUG_RETURN(0);
}
+int STDCALL
+mysql_real_query(MYSQL *mysql, const char *query, uint length)
+{
+ DBUG_ENTER("mysql_real_query");
+ DBUG_PRINT("enter",("handle: %lx",mysql));
+ DBUG_PRINT("query",("Query = \"%s\"",query));
+ if (mysql_send_query(mysql, query, length))
+ DBUG_RETURN(-1);
+ DBUG_RETURN(mysql_read_query_result(mysql));
+}
+
static int
send_file_to_server(MYSQL *mysql, const char *filename)