summaryrefslogtreecommitdiff
path: root/include/mysql.h
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-01-21 21:07:59 +0200
committerunknown <monty@mashka.mysql.fi>2003-01-21 21:07:59 +0200
commit10e22c346a4105c2c348ac500851e3b59cd9d887 (patch)
treeb3f7b07e6d74a88c6ef0b3e8f43bc27b784bb24d /include/mysql.h
parentfd86106365476d5c774cd4779164516a0e56744a (diff)
downloadmariadb-git-10e22c346a4105c2c348ac500851e3b59cd9d887.tar.gz
Portability fixes (for windows)
Some changes to the prepared statement protocol to make it easier to use and faster. Makefile.am: Fix to make dist to work with cmd-line-utils client/mysql.cc: Portability fixes client/mysqlbinlog.cc: Portabiliy fixes and remove usafe of FILE configure.in: Fix to make dist to work with cmd-line-utils heap/_check.c: Portability fixes include/config-win.h: Portability fixes include/m_ctype.h: Indentation cleanup include/my_list.h: Portability fixes include/mysql.h: Cleanup of BIND structure include/violite.h: Portability fixes innobase/dict/dict0dict.c: Portability fixes innobase/dict/dict0load.c: Portability fixes innobase/include/os0proc.h: Portability fixes (Heikki, please check) innobase/os/os0proc.c: Portability fixes (Heikki, please check) innobase/ut/ut0ut.c: Portability fixes isam/pack_isam.c: Portability fixes libmysql/libmysql.c: Portability fixes Remove obscure usage of the length parameter for prepared statements. libmysql/libmysql.def: Remove not existing functions libmysqld/lib_sql.cc: Remove compiler warning mysql-test/r/explain.result: Fix after merge mysql-test/r/join.result: Fix after merge mysys/my_once.c: Portability fix mysys/tree.c: Portability fixes sql/field.cc: Portability fixes sql/filesort.cc: move assert.h to mysql_priv.h sql/ha_berkeley.cc: move assert.h to mysql_priv.h sql/ha_innodb.cc: move assert.h to mysql_priv.h sql/item.cc: move assert.h to mysql_priv.h Fixed syntax error sql/item_cmpfunc.cc: move assert.h to mysql_priv.h sql/item_func.cc: move assert.h to mysql_priv.h sql/item_row.cc: move assert.h to mysql_priv.h sql/item_strfunc.cc: Portability fix sql/item_subselect.cc: Portability fix sql/item_sum.cc: move assert.h to mysql_priv.h sql/lex.h: Portability fix sql/lock.cc: move assert.h to mysql_priv.h sql/log.cc: move assert.h to mysql_priv.h sql/log_event.cc: Portability fix sql/mf_iocache.cc: move assert.h to mysql_priv.h sql/mysql_priv.h: move assert.h to mysql_priv.h sql/mysqld.cc: move assert.h to mysql_priv.h sql/opt_range.cc: move assert.h to mysql_priv.h sql/password.c: Portability fix sql/protocol.cc: move assert.h to mysql_priv.h sql/set_var.cc: Portability fix sql/slave.cc: move assert.h to mysql_priv.h sql/spatial.cc: Portability fix sql/sql_acl.cc: move assert.h to mysql_priv.h sql/sql_base.cc: move assert.h to mysql_priv.h sql/sql_cache.cc: move assert.h to mysql_priv.h sql/sql_class.cc: move assert.h to mysql_priv.h sql/sql_handler.cc: move assert.h to mysql_priv.h sql/sql_help.cc: Removed compiler warning sql/sql_lex.cc: Portability fix sql/sql_lex.h: Portability fix sql/sql_parse.cc: move assert.h to mysql_priv.h sql/sql_prepare.cc: move assert.h to mysql_priv.h sql/sql_repl.cc: move assert.h to mysql_priv.h sql/sql_select.cc: move assert.h to mysql_priv.h sql/sql_string.cc: Portability fix sql/sql_string.h: Portability fix sql/sql_table.cc: move assert.h to mysql_priv.h sql/sql_yacc.yy: Portability fix Remove not accessed code strings/ctype-bin.c: Portability fix strings/ctype-mb.c: Portability fix strings/ctype.c: Portability fix tests/client_test.c: A
Diffstat (limited to 'include/mysql.h')
-rw-r--r--include/mysql.h32
1 files changed, 14 insertions, 18 deletions
diff --git a/include/mysql.h b/include/mysql.h
index 2e2558d7183..3935963e84c 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -439,17 +439,17 @@ enum PREP_STMT_STATE { MY_ST_UNKNOWN, MY_ST_PREPARE, MY_ST_EXECUTE };
/* bind structure */
typedef struct st_mysql_bind
{
- long *length; /* output length pointer */
- gptr buffer; /* buffer */
+ unsigned long *length; /* output length pointer */
+ my_bool *is_null; /* Pointer to null indicators */
+ char *buffer; /* buffer to get/put data */
enum enum_field_types buffer_type; /* buffer type */
- my_bool is_null; /* NULL indicator */
- my_bool is_long_data; /* long data indicator */
+ /* Must be set for string/blob data */
+ unsigned long buffer_length; /* buffer length */
/* The following are for internal use. Set by mysql_bind_param */
- unsigned long buffer_length; /* buffer length */
- long bind_length; /* Default length of data */
- my_bool long_ended; /* All data supplied for long */
+ unsigned long bind_length; /* Default length of data */
unsigned int param_number; /* For null count and error messages */
+ my_bool long_data_used; /* If used with mysql_send_long_data */
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row);
} MYSQL_BIND;
@@ -465,20 +465,21 @@ typedef struct st_mysql_stmt
MYSQL_FIELD *fields; /* prepare meta info */
LIST list; /* list to keep track of all stmts */
char *query; /* query buffer */
+ char *buffer; /* buffer to hold results */
MEM_ROOT mem_root; /* root allocations */
MYSQL_RES tmp_result; /* Used by mysql_prepare_result */
unsigned long param_count; /* parameters count */
unsigned long field_count; /* fields count */
- unsigned long long_length; /* long buffer alloced length */
+ unsigned long buffer_length; /* long buffer alloced length */
unsigned long stmt_id; /* Id for prepared statement */
unsigned int last_errno; /* error code */
enum PREP_STMT_STATE state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
my_bool long_alloced; /* flag to indicate long alloced */
- my_bool send_types_to_server; /* to indicate types supply to server */
- my_bool param_buffers; /* to indicate the param bound buffers */
- my_bool res_buffers; /* to indicate the output bound buffers */
- my_bool result_buffered; /* to indicate the results buffered */
+ my_bool send_types_to_server; /* Types sent to server */
+ my_bool param_buffers; /* param bound buffers */
+ my_bool res_buffers; /* output bound buffers */
+ my_bool result_buffered; /* Results buffered */
} MYSQL_STMT;
@@ -498,10 +499,7 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt);
my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt,
unsigned int param_number,
const char *data,
- unsigned long length,
- my_bool last_data);
-int STDCALL mysql_multi_query(MYSQL *mysql,const char *query,
- unsigned long len);
+ unsigned long length);
MYSQL_RES *STDCALL mysql_prepare_result(MYSQL_STMT *stmt);
my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
@@ -515,8 +513,6 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql);
#define MYSQL_STATUS_ERROR 1
#define MYSQL_NO_DATA 100
#define MYSQL_NEED_DATA 99
-#define MYSQL_NULL_DATA (-1)
-#define MYSQL_LONG_DATA (-2)
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)