Commit cc090417 authored by unknown's avatar unknown

SCRUM

client code added to the embedded library
some fixes


include/mysql.h:
  test code removed
  simple_command is the macrodefinition now
libmysqld/embedded_priv.h:
  this declaration obsolete
libmysqld/lib_sql.cc:
  errors stored in the same place for embedded and client libraries now
sql-common/client.c:
  we don't need that ugly wrapper
parent 76ad2da5
...@@ -204,8 +204,6 @@ enum mysql_rpl_type ...@@ -204,8 +204,6 @@ enum mysql_rpl_type
struct st_mysql_methods; struct st_mysql_methods;
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
typedef struct st_mysql typedef struct st_mysql
{ {
NET net; /* Communication parameters */ NET net; /* Communication parameters */
...@@ -250,40 +248,13 @@ typedef struct st_mysql ...@@ -250,40 +248,13 @@ typedef struct st_mysql
LIST *stmts; /* list of all statements */ LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods; const struct st_mysql_methods *methods;
#if !defined(CHECK_EMBEDDED_DIFFERENCES)
struct st_mysql_res *result; struct st_mysql_res *result;
void *thd; void *thd;
unsigned int last_errno; unsigned int last_errno;
char *last_error; char *last_error;
char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */ char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */
#endif
} MYSQL; } 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 { typedef struct st_mysql_res {
my_ulonglong row_count; my_ulonglong row_count;
MYSQL_FIELD *fields; MYSQL_FIELD *fields;
...@@ -638,9 +609,9 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); ...@@ -638,9 +609,9 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
They are not for general usage They are not for general usage
*/ */
my_bool #define simple_command(mysql, command, arg, length, skip_check) \
simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg, (*(mysql)->methods->advanced_command)(mysql, command, \
unsigned long length, my_bool skip_check); NullS, 0, arg, length, skip_check)
unsigned long net_safe_read(MYSQL* mysql); unsigned long net_safe_read(MYSQL* mysql);
void mysql_once_init(void); void mysql_once_init(void);
......
...@@ -26,6 +26,4 @@ C_MODE_START ...@@ -26,6 +26,4 @@ C_MODE_START
extern void lib_connection_phase(NET *net, int phase); extern void lib_connection_phase(NET *net, int phase);
extern void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db); extern void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db);
extern void *create_embedded_thd(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 C_MODE_END
...@@ -74,7 +74,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -74,7 +74,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
result= thd->net.last_errno ? -1 : 0; result= thd->net.last_errno ? -1 : 0;
mysql->last_error= thd->net.last_error; 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; return result;
} }
......
...@@ -658,15 +658,6 @@ end: ...@@ -658,15 +658,6 @@ end:
return result; 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) void free_old_query(MYSQL *mysql)
{ {
DBUG_ENTER("free_old_query"); 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