Commit 1374a58c authored by hf@deer.(none)'s avatar hf@deer.(none)

SCRUM

client code added to the embedded library
some fixes
parent ece1a581
......@@ -204,8 +204,6 @@ enum mysql_rpl_type
struct st_mysql_methods;
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
typedef struct st_mysql
{
NET net; /* Communication parameters */
......@@ -250,40 +248,13 @@ typedef struct st_mysql
LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods;
#if !defined(CHECK_EMBEDDED_DIFFERENCES)
struct st_mysql_res *result;
void *thd;
unsigned int last_errno;
char *last_error;
char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */
#endif
} MYSQL;
#else
struct st_mysql_res;
typedef struct st_mysql
{
struct st_mysql_res *result;
void *thd;
struct charset_info_st *charset;
unsigned int server_language;
MYSQL_FIELD *fields;
MEM_ROOT field_alloc;
my_ulonglong affected_rows;
unsigned int field_count;
struct st_mysql_options options;
enum mysql_status status;
my_bool free_me; /* If free in mysql_close */
my_ulonglong insert_id; /* id if insert on table with NEXTNR */
unsigned int last_errno;
char *last_error; /* Used by embedded server */
char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */
} MYSQL;
#endif
typedef struct st_mysql_res {
my_ulonglong row_count;
MYSQL_FIELD *fields;
......@@ -638,9 +609,9 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
They are not for general usage
*/
my_bool
simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
unsigned long length, my_bool skip_check);
#define simple_command(mysql, command, arg, length, skip_check) \
(*(mysql)->methods->advanced_command)(mysql, command, \
NullS, 0, arg, length, skip_check)
unsigned long net_safe_read(MYSQL* mysql);
void mysql_once_init(void);
......
......@@ -26,6 +26,4 @@ C_MODE_START
extern void lib_connection_phase(NET *net, int phase);
extern void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db);
extern void *create_embedded_thd(int client_flag, char *db);
extern my_bool simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
ulong length, my_bool skipp_check);
C_MODE_END
......@@ -74,7 +74,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
result= thd->net.last_errno ? -1 : 0;
mysql->last_error= thd->net.last_error;
mysql->last_errno= thd->net.last_errno;
mysql->net.last_errno= thd->net.last_errno;
mysql->warning_count= ((THD*)mysql->thd)->total_warn_count;
return result;
}
......
......@@ -658,15 +658,6 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
return result;
}
my_bool
simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
ulong length, my_bool skip_check)
{
return
(*mysql->methods->advanced_command)(mysql, command,
NullS, 0, arg, length, skip_check);
}
void free_old_query(MYSQL *mysql)
{
DBUG_ENTER("free_old_query");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment