summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-06-24 12:10:35 +0300
committerunknown <monty@narttu.mysql.fi>2003-06-24 12:10:35 +0300
commitfff1f663c2d55faa57aaeae29df11515772c1b0b (patch)
tree415b1821c33eac5fc78fcb02664dfd546daa9406 /libmysqld
parent01450dbb79540c01e6b0381ce0760418dcdfc133 (diff)
downloadmariadb-git-fff1f663c2d55faa57aaeae29df11515772c1b0b.tar.gz
Fixed some new memory leaks
Updated VC++ files VC++Files/client/mysql.dsp: Update of VC++ files VC++Files/client/mysqlclient.dsp: Update of VC++ files VC++Files/libmysqld/examples/test_libmysqld.dsp: Update of VC++ files VC++Files/libmysqld/libmysqld.def: Update of VC++ files VC++Files/libmysqld/libmysqld.dsp: Update of VC++ files VC++Files/myisam/myisam.dsp: Update of VC++ files VC++Files/mysql.dsw: Update of VC++ files VC++Files/sql/mysqld.dsp: Update of VC++ files include/mysql.h: Add missing client functions to embedded server libmysql/libmysql.def: sort functions to enable comparison with libmysqld.def libmysqld/libmysqld.c: Add missing client functions to embedded server libmysqld/libmysqld.def: sort functions to enable comparison with libmysql.def Added missing functions myisam/mi_preload.c: Fixed compiler warning. Small code cleanup scripts/make_win_src_distribution.sh: Fixed typo Don't run zip in verbose mode scripts/mysql_create_system_tables.sh: Change so that localhost has full access (to make this like 4.0) scripts/mysql_fix_privilege_tables.sh: Allow on to run this from the source distribution sql-common/client.c: Fixed memory leak sql/item_sum.cc: Removed compiler warning sql/slave.cc: Cleanup sql/sql_client.cc: Portability fix sql/sql_help.cc: Fixed memory leak
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/libmysqld.c102
-rw-r--r--libmysqld/libmysqld.def183
2 files changed, 223 insertions, 62 deletions
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index a2d69b30c0d..ba2dfd68c00 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -49,6 +49,8 @@
static my_bool mysql_client_init=0;
uint mysql_port=0;
my_string mysql_unix_port=0;
+const char *not_error_sqlstate= "00000";
+
const char *sql_protocol_names_lib[] =
{ "TCP", "SOCKET", "PIPE", "MEMORY",NullS };
TYPELIB sql_protocol_typelib = {array_elements(sql_protocol_names_lib)-1,"",
@@ -516,6 +518,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
client_flag&= ~CLIENT_COMPRESS;
if (db)
client_flag|=CLIENT_CONNECT_WITH_DB;
+ mysql->server_status= SERVER_STATUS_AUTOCOMMIT;
if (mysql->options.init_commands)
{
@@ -1040,9 +1043,9 @@ mysql_list_fields(MYSQL *mysql __attribute__((unused)), const char *table __attr
/* List all running processes (threads) in server */
MYSQL_RES * STDCALL
-mysql_list_processes(MYSQL *mysql)
+mysql_list_processes(MYSQL *mysql __attribute__((unused)))
{
-#ifdef DUMMY
+#ifdef FOR_THE_FUTURE
MYSQL_DATA *fields;
uint field_count;
uchar *pos;
@@ -1063,7 +1066,7 @@ mysql_list_processes(MYSQL *mysql)
mysql->status=MYSQL_STATUS_GET_RESULT;
mysql->field_count=field_count;
DBUG_RETURN(mysql_store_result(mysql));
-#endif /*DUMMY*/
+#endif /* FOR_THE_FUTURE */
return 0;
}
@@ -1535,3 +1538,96 @@ myodbc_remove_escape(MYSQL *mysql,char *name)
}
*to=0;
}
+
+
+/********************************************************************
+ Transactional APIs
+*********************************************************************/
+
+/*
+ Commit the current transaction
+*/
+
+my_bool STDCALL mysql_commit(MYSQL * mysql)
+{
+ DBUG_ENTER("mysql_commit");
+ DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6));
+}
+
+/*
+ Rollback the current transaction
+*/
+
+my_bool STDCALL mysql_rollback(MYSQL * mysql)
+{
+ DBUG_ENTER("mysql_rollback");
+ DBUG_RETURN((my_bool) mysql_real_query(mysql, "rollback", 8));
+}
+
+
+/*
+ Set autocommit to either true or false
+*/
+
+my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
+{
+ DBUG_ENTER("mysql_autocommit");
+ DBUG_PRINT("enter", ("mode : %d", auto_mode));
+
+ if (auto_mode) /* set to true */
+ DBUG_RETURN((my_bool) mysql_real_query(mysql, "set autocommit=1", 16));
+ DBUG_RETURN((my_bool) mysql_real_query(mysql, "set autocommit=0", 16));
+}
+
+
+/********************************************************************
+ Multi query execution + SPs APIs
+*********************************************************************/
+
+/*
+ Returns if there are any more query results exists to be read using
+ mysql_next_result()
+*/
+
+my_bool STDCALL mysql_more_results(MYSQL *mysql)
+{
+ my_bool res;
+ DBUG_ENTER("mysql_more_results");
+
+ res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ?
+ 1: 0);
+ DBUG_PRINT("exit",("More results exists ? %d", res));
+ DBUG_RETURN(res);
+}
+
+
+/*
+ Reads and returns the next query results
+*/
+
+my_bool STDCALL mysql_next_result(MYSQL *mysql)
+{
+ DBUG_ENTER("mysql_next_result");
+
+ mysql->last_error[0]= 0;
+ mysql->last_errno= 0;
+ strmov(mysql->sqlstate, not_error_sqlstate);
+ mysql->affected_rows= ~(my_ulonglong) 0;
+
+ if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
+ DBUG_RETURN(mysql_read_query_result(mysql));
+
+ DBUG_RETURN(0);
+}
+
+
+my_bool STDCALL
+mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
+ const char *key __attribute__((unused)),
+ const char *cert __attribute__((unused)),
+ const char *ca __attribute__((unused)),
+ const char *capath __attribute__((unused)),
+ const char *cipher __attribute__((unused)))
+{
+ return 0;
+}
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index c6615ee971c..c3f757b5f1a 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -1,65 +1,130 @@
LIBRARY LIBMYSQLD
-DESCRIPTION 'MySQL 4.0 Embedded Server Library'
-VERSION 4.0
+DESCRIPTION 'MySQL 4.1 Embedded Server Library'
+VERSION 4.1
EXPORTS
- mysql_server_end
- mysql_server_init
- mysql_use_result
- mysql_thread_safe
- mysql_thread_id
- mysql_store_result
- mysql_stat
- mysql_shutdown
- mysql_select_db
- mysql_row_tell
- mysql_row_seek
- mysql_real_query
- mysql_real_connect
- mysql_query
- mysql_ping
- mysql_options
- mysql_num_rows
- mysql_num_fields
- mysql_list_tables
- mysql_list_processes
- mysql_list_fields
- mysql_list_dbs
- mysql_kill
- mysql_insert_id
- mysql_init
- mysql_info
- mysql_get_server_info
- mysql_get_proto_info
- mysql_get_host_info
- mysql_get_client_info
- mysql_free_result
- mysql_field_tell
- mysql_field_count
- mysql_field_seek
- mysql_fetch_row
- mysql_fetch_lengths
- mysql_fetch_fields
- mysql_fetch_field_direct
- mysql_fetch_field
- mysql_escape_string
- mysql_real_escape_string
- mysql_error
- mysql_errno
- mysql_eof
- mysql_dump_debug_info
- mysql_drop_db
- mysql_debug
- mysql_data_seek
- mysql_create_db
- mysql_character_set_name
+ _dig_vec
+ bmove_upp
+ delete_dynamic
+ free_defaults
+ getopt_compare_strings
+ getopt_ull_limit_value
+ handle_options
+ init_dynamic_array
+ insert_dynamic
+ int2str
+ is_prefix
+ list_add
+ list_delete
+ load_defaults
+ max_allowed_packet
+ my_end
+ my_getopt_print_errors
+ my_init
+ my_malloc
+ my_memdup
+ my_no_flags_free
+ my_path
+ my_print_help
+ my_print_variables
+ my_realloc
+ my_strdup
+ my_thread_end
+ my_thread_init
+ myodbc_remove_escape
+ mysql_affected_rows
+ mysql_autocommit
mysql_change_user
- mysql_connect
+ mysql_character_set_name
mysql_close
- mysql_affected_rows
- mysql_thread_init
- mysql_thread_end
- mysql_send_query
+ mysql_commit
+ mysql_data_seek
+ mysql_debug
+ mysql_dump_debug_info
+ mysql_eof
+ mysql_errno
+ mysql_error
+ mysql_escape_string
+ mysql_fetch_field
+ mysql_fetch_field_direct
+ mysql_fetch_fields
+ mysql_fetch_lengths
+ mysql_fetch_row
+ mysql_field_count
+ mysql_field_seek
+ mysql_field_tell
+ mysql_free_result
+ mysql_get_client_info
+ mysql_get_host_info
+ mysql_get_proto_info
+ mysql_get_server_info
+ mysql_info
+ mysql_init
+ mysql_insert_id
+ mysql_kill
+ mysql_list_dbs
+ mysql_list_fields
+ mysql_list_processes
+ mysql_list_tables
+ mysql_more_results
+ mysql_next_result
+ mysql_num_fields
+ mysql_num_rows
+ mysql_odbc_escape_string
+ mysql_options
+ mysql_ping
+ mysql_query
mysql_read_query_result
+ mysql_real_connect
+ mysql_real_escape_string
+ mysql_real_query
mysql_refresh
- mysql_odbc_escape_string
- myodbc_remove_escape
+ mysql_rollback
+ mysql_row_seek
+ mysql_row_tell
+ mysql_select_db
+ mysql_send_query
+ mysql_shutdown
+ mysql_ssl_set
+ mysql_stat
+ mysql_store_result
+ mysql_sqlstate
+ mysql_thread_id
+ mysql_thread_safe
+ mysql_use_result
+ mysql_warning_count
+ net_buffer_length
+ set_dynamic
+ strcend
+ strcont
+ strdup_root
+ strfill
+ strinstr
+ strmake
+ strmov
+ strxmov
+ mysql_server_end
+ mysql_server_init
+ get_tty_password
+ sql_protocol_typelib
+ mysql_get_server_version
+ mysql_sqlstate
+ charsets_dir
+ disabled_my_option
+ my_charset_latin1
+ init_alloc_root
+ my_progname
+ get_charset_by_csname
+ print_defaults
+ find_type
+ strxnmov
+ strend
+ my_fopen
+ my_fclose
+ unpack_filename
+ str2int
+ int10_to_str
+ longlong10_to_str
+ my_snprintf_8bit
+ alloc_root
+ free_root
+ my_read