Commit 5a28c2ca authored by unknown's avatar unknown
Browse files

Fixes and code cleanups after merge with 4.0.3

Warning handling and initial prepared statement handling (last not complete yet)
Changed a lot of functions that returned 0/1 to my_bool type.
GRANT handling now uses read/write locks instead of mutex
Change basic net functions to use THD instead of NET
(needed for 4.1 protocol)
Use my_sprintf instead of sprintf() + strlen()
Added alloc_query() to be able to chare query initialization code with
prepared statements.
Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID()

Note that the following test fails (will be fixed ASAP):
sub_select, union, rpl_rotate_logs and rpl_mystery22


BitKeeper/deleted/.del-README~3449730baf983117:
  Delete: mysql-test/t/README
BitKeeper/deleted/.del-sql_error.cc~2f1caca8d2485dbe:
  Delete: libmysqld/sql_error.cc
BitKeeper/deleted/.del-sql_prepare.cc~f703729793935ed6:
  Delete: libmysqld/sql_prepare.cc
Docs/manual.texi:
  Updated variable list
client/mysql.cc:
  Show warning count to user.
client/mysqltest.c:
  Add warnings to test results
configure.in:
  New shared library version number
include/errmsg.h:
  Indentation cleanup
include/mysql.h:
  Removed MYSQL_ERROR
  Indentaion cleanups
include/mysql_com.h:
  Changed functions to returns true/false to my_bool.
include/mysqld_error.h:
  New error messages
isam/pack_isam.c:
  Indentation change
libmysql/Makefile.am:
  Fix of wrong merge
libmysql/Makefile.shared:
  Indentation cleanup
libmysql/errmsg.c:
  Removed not used errors
libmysql/libmysql.c:
  Change functions to return 1 on error (not -1)
  Change type of functions that returns 0/1 to my_bool
  Lot of code optimizations.
  Lot of changes for prepared statements. This now handles sending of binary data to server.
  Receving of binary data is not yet done (will have to wait until server code for this is ready)
  mysql_warning_count and mysql_warnings() implemented.
libmysql/libmysql.def:
  Added mysql_warnings and mysql_warning_count
libmysql/manager.c:
  Fixed wrong testing of result from my_connect()
libmysqld/lib_sql.cc:
  Removed global variable THR_NET
  Change basic net functions to use THD instead of NET
  GRANT handling now uses read/write locks instead of mutex
libmysqld/libmysqld.c:
  Changed functions to be my_bool
myisam/ft_boolean_search.c:
  Trivial code cleanup
myisam/ft_stopwords.c:
  Trivial code cleanup
myisam/mi_check.c:
  Update to 4.1 structures
myisam/myisampack.c:
  Trivial code cleanup
myisam/rt_key.c:
  Code cleanup
myisam/rt_test.c:
  Code cleanup
  Removed compiler warnings
myisam/sp_key.c:
  Indentation changes
myisam/sp_test.c:
  Removed compiler warnings
mysql-test/README:
  Updated to reflect the new --external flag.
mysql-test/mysql-test-run.sh:
  --local (start new server) is now default.
  Use --external to test against external server.
mysql-test/r/rollback.result:
  Updated for 4.1 warnings
mysql-test/r/rpl_log.result:
  Update for 4.1
mysql-test/t/rollback.test:
  Updated for 4.1 warnings
mysql-test/t/rpl_log_pos.test:
  Portability fix
mysys/hash.c:
  Indentation change
mysys/my_error.c:
  Indentation change
mysys/tree.c:
  Updated file description
sql/field.cc:
  Fixed bugs introduced by merge
  Use my_sprintf instead of sprintf() + strlen()
sql/field.h:
  Add CHARSET_INFO to field structure
sql/gstream.h:
  Indentation changes.
  Added GPL copyright header
sql/ha_innodb.cc:
  Updated parameters for net functions.
sql/item.cc:
  Updates of Item_param
  Indentation changes
sql/item.h:
  Removed size_of() function from item.
sql/item_func.cc:
  Update function usage for 4.1
  Added get_system_var()
sql/item_func.h:
  Indentation change
sql/item_strfunc.cc:
  Removed not needed inclusion of gstream.h
  Update to use system variables (from 4.0)
sql/item_sum.h:
  Removed size_of() functions from item.
sql/item_timefunc.cc:
  Change sprintf() + strlen() -> my_sprintf()
  Added length parameter to ->append()
sql/item_timefunc.h:
  Removed size_of() functions from item.
sql/item_uniq.h:
  Removed size_of() functions from item.
sql/lex.h:
  Removed SQL_ERROR_COUNT variable
sql/log.cc:
  Change sprintf() + strlen() -> my_sprintf()
sql/log_event.cc:
  Change sprintf() + strlen() -> my_sprintf()
sql/mini_client.cc:
  Added check that one always specifies a length to mc_mysql_query()
sql/mysql_priv.h:
  New prototypes
  Change of NET -> THD parameter for net functions.
sql/mysqld.cc:
  New startup options:  'max_prepared_statements', 'max_error_count'
  Updated usage of net functions.
sql/net_pkg.cc:
  Change basic net functions to use THD instead of NET
  (needed to be able to handle 4.0 and 4.1 protocols)
  Lots of function comments
sql/net_serv.cc:
  Change int return values -> my_bool
  Updated net_write_command() to take an extra header block to be added to the packet.
  (This made the prepared statement code much nicer and more efficient)
sql/repl_failsafe.cc:
  Update net functions to use THD instead of NET
sql/set_var.cc:
  Added @@error_count and @@warning_count variables.
  Updated to 4.1 function usage
sql/set_var.h:
  Added @@error_count and @@warning_count variables.
sql/share/czech/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/english/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/greek/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/hungarian/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/japanese/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/korean/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/norwegian-ny/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/norwegian/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/polish/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/romanian/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/slovak/errmsg.txt:
  Removed Warning: from warning error messages.
sql/share/swedish/errmsg.txt:
  Removed Warning: from warning error messages.
sql/slave.cc:
  Change basic net functions to use THD instead of NET
  skip_load_data_file recoded to fit new client/server protocol
sql/spatial.h:
  Added copyright header
  Indentation cleanups
sql/sql_acl.cc:
  Change basic net functions to use THD instead of NET
  GRANT handling now uses read/write locks instead of mutex
sql/sql_analyse.cc:
  Change basic net functions to use THD instead of NET
  sprintf() + strlen() -> my_sprintf()
sql/sql_base.cc:
  More DBUG statements
sql/sql_class.cc:
  Change basic net functions to use THD instead of NET
  warning and prepared statement handling
sql/sql_class.h:
  Change basic net functions to use THD instead of NET
  warning and prepared statement handling
sql/sql_db.cc:
  Code cleanup & optimization.
sql/sql_delete.cc:
  Change basic net functions to use THD instead of NET
sql/sql_derived.cc:
  Change basic net functions to use THD instead of NET
sql/sql_do.cc:
  Change basic net functions to use THD instead of NET
sql/sql_error.cc:
  Big rewrite of error handling.
sql/sql_handler.cc:
  Change basic net functions to use THD instead of NET
sql/sql_insert.cc:
  Change basic net functions to use THD instead of NET
sql/sql_lex.cc:
  Change basic net functions to use THD instead of NET
sql/sql_lex.h:
  Added param_count to st_select_lex_node
sql/sql_list.h:
  Removed not needed error list.
sql/sql_load.cc:
  Change basic net functions to use THD instead of NET
sql/sql_parse.cc:
  Change basic net functions to use THD instead of NET
  Added alloc_query() to be able to chare query initialization code with
  prepared statements.
  Update of warning handling.
  Added create_select_for_variable() (for SHOW COUNT(*) WARNINGS)
sql/sql_prepare.cc:
  Initial prepared statement handling
sql/sql_rename.cc:
  Change basic net functions to use THD instead of NET
sql/sql_repl.cc:
  Change basic net functions to use THD instead of NET
sql/sql_select.cc:
  Small code cleanups
  Added missing initialization of error that caused some queries that returned an empty result set to fail
sql/sql_select.h:
  Ensure that JOIN.error is properly initialized
sql/sql_show.cc:
  Change basic net functions to use THD instead of NET
  A lot of optimization
sql/sql_table.cc:
  Change basic net functions to use THD instead of NET
  Indentaion cleanup
sql/sql_udf.cc:
  Change basic net functions to use THD instead of NET
sql/sql_union.cc:
  Change basic net functions to use THD instead of NET
sql/sql_update.cc:
  Change basic net functions to use THD instead of NET
sql/sql_yacc.yy:
  Change basic net functions to use THD instead of NET
  Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID()
sql/structs.h:
  Moved structures to files where they was used
sql/table.cc:
  Don't accept empty database names
sql/uniques.cc:
  Indentation cleanup
sql/unireg.cc:
  Change basic net functions to use THD instead of NET
sql/unireg.h:
  Added defaults for warnings and prepared statements
strings/ctype-simple.c:
  optimization
tests/client_test.c:
  Fixed wrong paramaters to printf()
parent 9421f1da
......@@ -28684,6 +28684,7 @@ and if you can use @code{GLOBAL} or @code{SESSION} with them.
@item delayed_insert_limit @tab num @tab GLOBAL
@item delayed_insert_timeout @tab num @tab GLOBAL
@item delayed_queue_size @tab num @tab GLOBAL
@item error_count @tab num @tab LOCAL
@item flush @tab bool @tab GLOBAL
@item flush_time @tab num @tab GLOBAL
@item foreign_key_checks @tab bool @tab SESSION
......@@ -28702,6 +28703,7 @@ and if you can use @code{GLOBAL} or @code{SESSION} with them.
@item max_binlog_size @tab num @tab GLOBAL
@item max_connect_errors @tab num @tab GLOBAL
@item max_connections @tab num @tab GLOBAL
@item max_error_count @tab num @tab GLOBAL | SESSION
@item max_delayed_threads @tab num @tab GLOBAL
@item max_heap_table_size @tab num @tab GLOBAL | SESSION
@item max_join_size @tab num @tab GLOBAL | SESSION
......@@ -28750,6 +28752,7 @@ and if you can use @code{GLOBAL} or @code{SESSION} with them.
@item tx_isolation @tab enum @tab GLOBAL | SESSION
@item version @tab string @tab GLOBAL
@item wait_timeout @tab num @tab GLOBAL | SESSION
@item warning_count @tab num @tab LOCAL
@item unique_checks @tab bool @tab SESSION
@end multitable
 
......@@ -40,7 +40,7 @@
#include <signal.h>
#include <violite.h>
const char *VER= "12.12";
const char *VER= "12.13";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
......@@ -1362,9 +1362,9 @@ com_clear(String *buffer,char *line __attribute__((unused)))
static int
com_go(String *buffer,char *line __attribute__((unused)))
{
char buff[160],time_buff[32];
char buff[200], time_buff[32], *pos;
MYSQL_RES *result;
ulong timer;
ulong timer, warnings;
uint error=0;
if (!status.batch)
......@@ -1447,7 +1447,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
{
if (!mysql_num_rows(result) && ! quick)
{
sprintf(buff,"Empty set%s",time_buff);
strmov(buff, "Empty set");
}
else
{
......@@ -1462,20 +1462,30 @@ com_go(String *buffer,char *line __attribute__((unused)))
print_tab_data(result);
else
print_table_data(result);
sprintf(buff,"%ld %s in set%s",
sprintf(buff,"%ld %s in set",
(long) mysql_num_rows(result),
(long) mysql_num_rows(result) == 1 ? "row" : "rows",
time_buff);
(long) mysql_num_rows(result) == 1 ? "row" : "rows");
end_pager();
}
}
else if (mysql_affected_rows(&mysql) == ~(ulonglong) 0)
sprintf(buff,"Query OK%s",time_buff);
strmov(buff,"Query OK");
else
sprintf(buff,"Query OK, %ld %s affected%s",
sprintf(buff,"Query OK, %ld %s affected",
(long) mysql_affected_rows(&mysql),
(long) mysql_affected_rows(&mysql) == 1 ? "row" : "rows",
time_buff);
(long) mysql_affected_rows(&mysql) == 1 ? "row" : "rows");
pos=strend(buff);
if ((warnings= mysql_warning_count(&mysql)))
{
*pos++= ',';
*pos++= ' ';
pos=int2str(warnings, pos, 10);
pos=strmov(pos, " warning");
if (warnings != 1)
*pos++= 's';
}
strmov(pos, time_buff);
put_info(buff,INFO_RESULT);
if (mysql_info(&mysql))
put_info(mysql_info(&mysql),INFO_RESULT);
......
......@@ -311,7 +311,7 @@ static int eval_result = 0;
void mysql_enable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; }
int mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
#endif
#define MAX_SERVER_ARGS 20
......@@ -1073,7 +1073,7 @@ int do_disable_rpl_parse(struct st_query* q __attribute__((unused)))
}
int do_sleep(struct st_query* q)
int do_sleep(struct st_query* q, my_bool real_sleep)
{
char *p=q->first_argument;
struct timeval t;
......@@ -2055,6 +2055,36 @@ static void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
dynstr_append_mem(ds, val, len);
}
/*
Append all results to the dynamic string separated with '\t'
*/
static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
{
MYSQL_ROW row;
int num_fields= mysql_num_fields(res);
unsigned long *lengths;
while ((row = mysql_fetch_row(res)))
{
int i;
lengths = mysql_fetch_lengths(res);
for (i = 0; i < num_fields; i++)
{
const char *val= row[i];
ulonglong len= lengths[i];
if (!val)
{
val = "NULL";
len = 4;
}
if (i)
dynstr_append_mem(ds, "\t", 1);
replace_dynstr_append_mem(ds, val, len);
}
dynstr_append_mem(ds, "\n", 1);
}
}
/*
* flags control the phased/stages of query execution to be performed
......@@ -2065,12 +2095,7 @@ static void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
int run_query(MYSQL* mysql, struct st_query* q, int flags)
{
MYSQL_RES* res = 0;
MYSQL_FIELD* fields;
MYSQL_ROW row;
int num_fields,i, error = 0;
unsigned long* lengths;
char* val;
int len;
int i, error = 0;
DYNAMIC_STRING *ds;
DYNAMIC_STRING ds_tmp;
DYNAMIC_STRING eval_query;
......@@ -2178,45 +2203,37 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
goto end;
}
if (!res)
goto end;
if (!disable_result_log)
if (!disable_result_log && res)
{
fields = mysql_fetch_fields(res);
num_fields = mysql_num_fields(res);
int num_fields= mysql_num_fields(res);
MYSQL_FIELD *fields= mysql_fetch_fields(res);
for (i = 0; i < num_fields; i++)
{
if (i)
dynstr_append_mem(ds, "\t", 1);
dynstr_append(ds, fields[i].name);
}
dynstr_append_mem(ds, "\n", 1);
append_result(ds, res);
}
while ((row = mysql_fetch_row(res)))
/* Add all warnings to the result */
if (!disable_result_log && mysql_warning_count(mysql))
{
MYSQL_RES *warn_res= mysql_warnings(mysql);
if (!warn_res)
verbose_msg("Warning count is %d but didn't get any warnings\n",
mysql_warning_count(mysql));
else
{
lengths = mysql_fetch_lengths(res);
for (i = 0; i < num_fields; i++)
{
val = (char*)row[i];
len = lengths[i];
if (!val)
{
val = (char*)"NULL";
len = 4;
}
if (i)
dynstr_append_mem(ds, "\t", 1);
replace_dynstr_append_mem(ds, val, len);
}
dynstr_append_mem(ds, "\n", 1);
dynstr_append_mem(ds, "Warnings:\n", 10);
append_result(ds, warn_res);
mysql_free_result(warn_res);
}
if (glob_replace)
free_replace();
}
if (glob_replace)
free_replace();
if (record)
{
if (!q->record_file[0] && !result_file)
......
......@@ -10,7 +10,7 @@ AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
DOT_FRM_VERSION=6
# See the libtool docs for information on how to do shared lib versions.
SHARED_LIB_VERSION=11:0:0
SHARED_LIB_VERSION=12:0:0
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
......
......@@ -63,15 +63,12 @@ extern const char *client_errors[]; /* Error messages */
#define CR_PROBE_MASTER_CONNECT 2025
/* new 4.1 error codes */
#define CR_INVALID_CONN_HANDLE 2026
#define CR_NULL_POINTER 2027
#define CR_MEMORY_ERROR 2028
#define CR_NO_PREPARE_STMT 2029
#define CR_NOT_ALL_PARAMS_BOUND 2030
#define CR_DATA_TRUNCATED 2031
#define CR_NOT_ALL_BUFFERS_BOUND 2032
#define CR_FAILED_TO_SET_PARAM_DATA 2033
#define CR_NO_PARAMETERS_EXISTS 2033
#define CR_INVALID_PARAMETER_NO 2035
#define CR_INVALID_BUFFER_USE 2036
#define CR_INVALID_CONN_HANDLE 2026
#define CR_NULL_POINTER 2027
#define CR_NO_PREPARE_STMT 2028
#define CR_NOT_ALL_PARAMS_BOUND 2029
#define CR_DATA_TRUNCATED 2030
#define CR_NO_PARAMETERS_EXISTS 2031
#define CR_INVALID_PARAMETER_NO 2032
#define CR_INVALID_BUFFER_USE 2033
#define CR_UNSUPPORTED_PARAM_TYPE 2034
......@@ -157,7 +157,8 @@ enum mysql_rpl_type { MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE,
MYSQL_RPL_ADMIN };
typedef struct st_mysql {
typedef struct st_mysql
{
NET net; /* Communication parameters */
gptr connector_fd; /* ConnectorFd for SSL */
char *host,*user,*passwd,*unix_socket,*server_version,*host_info,
......@@ -175,6 +176,7 @@ typedef struct st_mysql {
unsigned int field_count;
unsigned int server_status;
unsigned int server_language;
unsigned int warning_count;
struct st_mysql_options options;
enum mysql_status status;
my_bool free_me; /* If free in mysql_close */
......@@ -273,12 +275,13 @@ my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
unsigned int STDCALL mysql_errno(MYSQL *mysql);
const char * STDCALL mysql_error(MYSQL *mysql);
uint STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
const char * STDCALL mysql_character_set_name(MYSQL *mysql);
MYSQL * STDCALL mysql_init(MYSQL *mysql);
int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
......@@ -295,19 +298,19 @@ int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
int STDCALL mysql_query(MYSQL *mysql, const char *q);
int STDCALL mysql_send_query(MYSQL *mysql, const char *q,
unsigned long length);
int STDCALL mysql_read_query_result(MYSQL *mysql);
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
unsigned long length);
/* perform query on master */
int STDCALL mysql_master_query(MYSQL *mysql, const char *q,
unsigned long length);
int STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
unsigned long length);
my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
unsigned long length);
my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
unsigned long length);
/* perform query on slave */
int STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
unsigned long length);
int STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
unsigned long length);
my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
unsigned long length);
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
unsigned long length);
/*
enable/disable parsing of all queries to decide if they go on master or
......@@ -322,12 +325,12 @@ int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql);
void STDCALL mysql_enable_reads_from_master(MYSQL* mysql);
void STDCALL mysql_disable_reads_from_master(MYSQL* mysql);
/* get the value of the master read flag */
int STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);
my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);
enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len);
/* discover the master and its slaves */
int STDCALL mysql_rpl_probe(MYSQL* mysql);
my_bool STDCALL mysql_rpl_probe(MYSQL* mysql);
/* set the master, close/free the old one, if it is not a pivot */
int STDCALL mysql_set_master(MYSQL* mysql, const char* host,
......@@ -357,6 +360,7 @@ MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_warnings(MYSQL *mysql);
int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
const char *arg);
void STDCALL mysql_free_result(MYSQL_RES *result);
......@@ -401,7 +405,6 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
int res_buf_size);
/*
The following definitions are added for the enhanced
client-server protocol
......@@ -411,67 +414,76 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
enum MY_STMT_STATE { MY_ST_UNKNOWN, MY_ST_PREPARE, MY_ST_EXECUTE };
/* bind structure */
typedef struct st_mysql_bind {
enum enum_field_types buffer_type; /* buffer type */
enum enum_field_types field_type; /* field type */
gptr buffer; /* buffer */
long *length; /* output length pointer */
unsigned long buffer_length; /* buffer length */
unsigned long bind_length; /* internal use */
my_bool is_null; /* NULL indicator */
my_bool is_long_data; /* long data indicator */
my_bool long_ended; /* internal use */
typedef struct st_mysql_bind
{
long *length; /* output length pointer */
gptr buffer; /* buffer */
unsigned long buffer_length; /* buffer length */
enum enum_field_types buffer_type; /* buffer type */
enum enum_field_types field_type; /* field type */
my_bool is_null; /* NULL indicator */
my_bool is_long_data; /* long data indicator */
/* The following are for internal use. Set by mysql_bind_param */
long bind_length; /* Default length of data */
my_bool long_ended; /* All data supplied for long */
uint param_number; /* For null count and error messages */
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
char *(*fetch_result)(struct st_mysql_bind *, const char *row);
} MYSQL_BIND;
/* statement handler */
typedef struct st_mysql_stmt {
MYSQL *mysql; /* connection handle */
MYSQL_BIND *params; /* input parameters */
MYSQL_RES *result; /* resultset */
MYSQL_BIND *bind; /* row binding */
MYSQL_FIELD *fields; /* prepare meta info */
MEM_ROOT mem_root; /* root allocations */
unsigned long param_count; /* parameters count */
unsigned long field_count; /* fields count */
unsigned long long_length; /* long buffer alloced length */
uint err_no; /* error code */
char error[MYSQL_ERRMSG_SIZE]; /* error message */
char *query; /* query buffer */
char *long_data; /* long buffer */
enum MY_STMT_STATE state; /* statement state */
my_bool long_alloced; /* flag to indicate long alloced */
my_bool types_supplied; /* to indicate types supply */
/* statement handler */
typedef struct st_mysql_stmt
{
MYSQL *mysql; /* connection handle */
MYSQL_BIND *params; /* input parameters */
MYSQL_RES *result; /* resultset */
MYSQL_BIND *bind; /* row binding */
MYSQL_FIELD *fields; /* prepare meta info */
char *query; /* query buffer */
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 */
ulong stmt_id; /* Id for prepared statement */
uint last_errno; /* error code */
enum MY_STMT_STATE state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
my_bool long_alloced; /* flag to indicate long alloced */
my_bool types_supplied; /* to indicate types supply */
} MYSQL_STMT;
MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query);
MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query,
unsigned long length);
int STDCALL mysql_execute(MYSQL_STMT * stmt);
unsigned long STDCALL mysql_param_count(MYSQL_STMT * stmt);
int STDCALL mysql_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bind);
int STDCALL mysql_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bind);
int STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
my_bool STDCALL mysql_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bind);
my_bool STDCALL mysql_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bind);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
uint STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
int STDCALL mysql_commit(MYSQL * mysql);
int STDCALL mysql_rollback(MYSQL * mysql);
int STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
int STDCALL mysql_fetch(MYSQL_STMT *stmt);
my_bool STDCALL mysql_commit(MYSQL * mysql);
my_bool STDCALL mysql_rollback(MYSQL * mysql);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
int STDCALL mysql_fetch(MYSQL_STMT *stmt);
my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt,
uint param_number,gptr data,
unsigned long length);
int STDCALL mysql_multi_query(MYSQL *mysql,const char *query,unsigned long len);
uint 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);
MYSQL_RES *STDCALL mysql_next_result(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_prepare_result(MYSQL_STMT *stmt);
MYSQL_RES *STDCALL mysql_prepare_result(MYSQL_STMT *stmt);
/* new status messages */
#define MYSQL_SUCCESS 0
#define MYSQL_WARNING 1
#define MYSQL_ERROR -1
#define MYSQL_STATUS_ERROR 2
#define MYSQL_NO_DATA 100
#define MYSQL_NEED_DATA 99
#define MYSQL_LONG_DATA_END 0xFF
......@@ -492,8 +504,9 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
They are not for general usage
*/
int simple_command(MYSQL *mysql,enum enum_server_command command,
const char *arg, unsigned long length, my_bool skipp_check);
my_bool
simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
ulong length, my_bool skip_check);
unsigned long net_safe_read(MYSQL* mysql);
#ifdef __cplusplus
......
......@@ -34,15 +34,15 @@
#define MYSQL_SERVICENAME "MySql"
#endif /* __WIN__ */
enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
COM_FIELD_LIST,COM_CREATE_DB,COM_DROP_DB,COM_REFRESH,
COM_SHUTDOWN,COM_STATISTICS,
COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT,
COM_CHANGE_USER, COM_BINLOG_DUMP,
COM_TABLE_DUMP, COM_CONNECT_OUT,
COM_REGISTER_SLAVE,
COM_PREPARE,COM_EXECUTE,COM_LONG_DATA };
enum enum_server_command
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_PREPARE, COM_EXECUTE, COM_LONG_DATA, COM_CLOSE_STMT
};
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
......@@ -98,8 +98,9 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
#define CLIENT_PROTOCOL_41 16384 /* New 4.1 protocol */
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_STATUS_MORE_RESULTS 4 /* More results on server */
#define MYSQL_ERRMSG_SIZE 200
#define NET_READ_TIMEOUT 30 /* Timeout on read */
......@@ -203,21 +204,26 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
extern "C" {
#endif
int my_net_init(NET *net, Vio* vio);
my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net);
int net_flush(NET *net);
int my_net_write(NET *net,const char *packet,unsigned long len);
int net_write_command(NET *net,unsigned char command,const char *packet,
unsigned long len);
my_bool net_realloc(NET *net, unsigned long length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net,const char *packet,unsigned long len);
my_bool net_write_command(NET *net,unsigned char command,
const char *header, unsigned long head_len,
const char *packet, unsigned long len);
int net_real_write(NET *net,const char *packet,unsigned long len);
unsigned long my_net_read(NET *net);
/* The following function is not meant for normal usage */
/*
The following function is not meant for normal usage
Currently it's used internally by manager.c
*/
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
unsigned int timeout);
my_bool my_connect(my_socket s, const struct sockaddr *name,
unsigned int namelen, unsigned int timeout);
struct rand_struct {
unsigned long seed1,seed2,max_value;
......@@ -291,6 +297,6 @@ void my_thread_end(void);
#endif
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
#define MYSQL_LONG_DATA_END 0xFF /* For indication of long data ending */
#define MYSQL_LONG_DATA_HEADER 8
#endif
......@@ -257,4 +257,5 @@
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1238
#define ER_SUBSELECT_NO_1_COL 1239
#define ER_SUBSELECT_NO_1_ROW 1240
#define ER_ERROR_MESSAGES 241
#define ER_UNKNOWN_STMT_HANDLER 1241
#define ER_ERROR_MESSAGES 242
......@@ -687,7 +687,8 @@ static HUFF_COUNTS *init_huff_count(N_INFO *info,my_off_t records)
(type == FIELD_NORMAL ||
type == FIELD_SKIP_ZERO))
count[i].max_zero_fill= count[i].field_length;
init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0,NULL,NULL);
init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0,
NULL, NULL);
if (records)
count[i].tree_pos=count[i].tree_buff =
my_malloc(count[i].field_length > 1 ? tree_buff_length : 2,
......
......@@ -49,10 +49,6 @@ link_sources:
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \
done; \
for f in $(mystringsgen); do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ ../strings/$$f $(srcdir)/$$f; \
done; \
for f in $$qs; do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../sql/$$f $(srcdir)/$$f; \
......
......@@ -39,9 +39,10 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo \
ctype.lo ctype-simple.lo ctype-mb.lo \
ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo ctype-win1250ch.lo\
ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \
ctype-win1250ch.lo ctype-utf8.lo \
ctype-gb2312.lo ctype-gbk.lo ctype-latin1_de.lo \
ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo ctype-utf8.lo
ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo
mystringsextra= strto.c
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
......
......@@ -52,15 +52,13 @@ const char *client_errors[]=
"Error connecting to master:",
"Invalid connection handle",
"Invalid use of null pointer",
"Memory allocation error",
"Statement not prepared",
"Not all parameters data supplied",
"Data truncated",
"Not all parameters bound for the row fetch",
"Failed to send the parameter data",
"No parameters exists in the statement",
"Invalid parameter number",
"Can't send long data for non string or binary data types"
"Can't send long data for non string or binary data types (parameter: %d)",
"Using not supported parameter type: %d (parameter: %d)"
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
......@@ -96,15 +94,13 @@ const char *client_errors[]=
"Error connecting to master:",
"Invalid connection handle",
"Invalid use of null pointer",
"Memory allocation error",
"Statement not prepared",
"Not all parameters data supplied",
"Data truncated",
"Not all parameters bound for the row fetch",
"Failed to send the parameter data",
"No parameters exists in the statement",
"Invalid parameter number",
"Can't send long data for non string or binary data types"
"Can't send long data for non string or binary data types (parameter: %d)",
"Using not supported parameter type: %d (parameter: %d)"
};
#else /* ENGLISH */
......@@ -138,15 +134,13 @@ const char *client_errors[]=
"Error connecting to master:",
"Invalid connection handle",
"Invalid use of null pointer",
"Memory allocation error",
"Statement not prepared",
"Not all parameters data supplied",
"Data truncated",
"Not all parameters bound for the row fetch",
"Failed to send the parameter data",
"No parameters exists in the statement",
"Invalid parameter number",
"Can't send long data for non string or binary data types"
"Can't send long data for non string or binary data types (parameter: %d)",
"Using not supported parameter type: %d (parameter: %d)"
};
#endif
......
This diff is collapsed.
......@@ -104,8 +104,8 @@ EXPORTS
mysql_rpl_probe
mysql_set_master
mysql_add_slave
mysql_warning_count
mysql_warnings
......
......@@ -138,7 +138,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
}
sock_addr.sin_port = (ushort) htons((ushort) port);
if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
0) <0)
0))
{
con->last_errno=errno;
sprintf(con->last_error ,"Could not connect to %-.64s", host);
......
......@@ -154,14 +154,12 @@ check_connections1(THD *thd)
end+=SCRAMBLE_LENGTH +1;
int2store(end,client_flags);
end[2]=MY_CHARSET_CURRENT;
#define MIN_HANDSHAKE_SIZE 6
int2store(end+3,thd->server_status);
bzero(end+5,13);
end+=18;
if (net_write_command(net,protocol_version, buff,
(uint) (end-buff)))
if (net_write_command(net,protocol_version,
NullS, 0,
buff, (uint) (end-buff)))
{
inc_host_errors(&thd->remote.sin_addr);
return(ER_HANDSHAKE_ERROR);
......@@ -169,6 +167,8 @@ check_connections1(THD *thd)
return 0;
}
#define MIN_HANDSHAKE_SIZE 6
static int
check_connections2(THD * thd)
{
......@@ -214,13 +214,12 @@ check_connections2(THD * thd)
static bool check_user(THD *thd,enum_server_command command, const char *user,
const char *passwd, const char *db, bool check_count)
{
NET *net= &thd->net;
USER_RESOURCES ur;
thd->db=0;
if (!(thd->user = my_strdup(user, MYF(0))))
{
send_error(net,ER_OUT_OF_RESOURCES);
send_error(thd,ER_OUT_OF_RESOURCES);
return 1;
}
thd->master_access=acl_getroot(thd, thd->host, thd->ip, thd->user,
......@@ -236,7 +235,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
thd->master_access, thd->db ? thd->db : "*none*"));
if (thd->master_access & NO_ACCESS)
{
net_printf(net, ER_ACCESS_DENIED_ERROR,
net_printf(thd, ER_ACCESS_DENIED_ERROR,
thd->user,
thd->host_or_ip,
passwd[0] ? ER(ER_YES) : ER(ER_NO));
......@@ -254,7 +253,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
VOID(pthread_mutex_unlock(&LOCK_thread_count));
if (tmp)
{ // Too many connections
send_error(net, ER_CON_COUNT_ERROR);
send_error(thd, ER_CON_COUNT_ERROR);
return(1);
}
}
......@@ -269,7 +268,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
if (db && db[0])
return test(mysql_change_db(thd,db));
else
send_ok(net); // Ready to handle questions
send_ok(thd); // Ready to handle questions
return 0; // ok
}
......@@ -370,7 +369,6 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
(void) pthread_mutex_init(&LOCK_mysql_create_db,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_grant,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_open,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW);
......@@ -388,6 +386,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
(void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
(void) my_rwlock_init(&LOCK_grant, NULL);
(void) pthread_cond_init(&COND_thread_count,NULL);
(void) pthread_cond_init(&COND_refresh,NULL);
(void) pthread_cond_init(&COND_thread_cache,NULL);
......@@ -499,7 +498,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
After this we can't quit by a simple unireg_abort
*/
error_handler_hook = my_message_sql;
if (pthread_key_create(&THR_THD,NULL) || pthread_key_create(&THR_NET,NULL) ||
if (pthread_key_create(&THR_THD,NULL) ||
pthread_key_create(&THR_MALLOC,NULL))
{
sql_print_error("Can't create thread-keys");
......
......@@ -212,12 +212,12 @@ static void free_rows(MYSQL_DATA *cur)
}
int
my_bool
simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
ulong length, my_bool skipp_check)
{
NET *net= &mysql->net;
int result= -1;
my_bool result= 1;
/* Check that we are calling the client functions in right order */
if (mysql->status != MYSQL_STATUS_READY)
......@@ -239,7 +239,7 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
result = lib_dispatch_command(command, net, arg,length);
if (!skipp_check)
result= ((mysql->packet_length=net_safe_read(mysql)) == packet_error ?
-1 : 0);
1 : 0);
end:
return result;
}
......@@ -1124,7 +1124,7 @@ mysql_send_query(MYSQL* mysql, const char* query, ulong length)
}
int STDCALL
my_bool STDCALL
mysql_read_query_result(MYSQL *mysql)
{
uchar *pos;
......@@ -1134,7 +1134,7 @@ mysql_read_query_result(MYSQL *mysql)
DBUG_ENTER("mysql_read_query_result");
if ((length=net_safe_read(mysql)) == packet_error)
DBUG_RETURN(-1);
DBUG_RETURN(1);
free_old_query(mysql); /* Free old result */
get_info:
pos=(uchar*) mysql->net.read_pos;
......@@ -1154,7 +1154,7 @@ get_info:
{
int error=send_file_to_server(mysql,(char*) pos);
if ((length=net_safe_read(mysql)) == packet_error || error)
DBUG_RETURN(-1);
DBUG_RETURN(1);
goto get_info; /* Get info packet */
}
if (!(mysql->server_status & SERVER_STATUS_AUTOCOMMIT))
......@@ -1162,19 +1162,19 @@ get_info:
mysql->extra_info= net_field_length_ll(&pos); /* Maybe number of rec */
if (!(fields=read_rows(mysql,(MYSQL_FIELD*) 0,5)))
DBUG_RETURN(-1);
DBUG_RETURN(1);
if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,
(uint) field_count,0,
(my_bool) test(mysql->server_capabilities &
CLIENT_LONG_FLAG))))
DBUG_RETURN(-1);
DBUG_RETURN(1);
mysql->status=MYSQL_STATUS_GET_RESULT;
mysql->field_count=field_count;
DBUG_RETURN(0);
}
/****************************************************************************
* A modified version of connect(). connect2() allows you to specify
* A modified version of connect(). my_connect() allows you to specify
* a timeout value, in seconds, that we should wait until we
* derermine we can't connect to a particular host. If timeout is 0,
* my_connect() will behave exactly like connect().
......@@ -1182,11 +1182,11 @@ get_info:
* Base version coded by Steve Bernacki, Jr. <steve@navinet.net>
*****************************************************************************/
int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
uint timeout)
my_bool my_connect(my_socket s, const struct sockaddr *name, uint namelen,
uint timeout)
{
#if defined(__WIN__) || defined(OS2)
return connect(s, (struct sockaddr*) name, namelen);
return connect(s, (struct sockaddr*) name, namelen) != 0;
#else
int flags, res, s_err;
SOCKOPT_OPTLEN_TYPE s_err_size = sizeof(uint);
......@@ -1199,7 +1199,7 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
*/
if (timeout == 0)
return connect(s, (struct sockaddr*) name, namelen);
return connect(s, (struct sockaddr*) name, namelen) != 0;
flags = fcntl(s, F_GETFL, 0); /* Set socket to not block */
#ifdef O_NONBLOCK
......@@ -1212,7 +1212,7 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
if ((res != 0) && (s_err != EINPROGRESS))
{
errno = s_err; /* Restore it */
return(-1);
return(1);
}
if (res == 0) /* Connected quickly! */
return(0);
......@@ -1252,7 +1252,7 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
now_time=time(NULL);
timeout-= (uint) (now_time - start_time);
if (errno != EINTR || (int) timeout <= 0)
return -1;
return 1;
}
/* select() returned something more interesting than zero, let's
......@@ -1262,12 +1262,12 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
s_err=0;
if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char*) &s_err, &s_err_size) != 0)
return(-1);
return(1);
if (s_err)
{ /* getsockopt could succeed */
errno = s_err;
return(-1); /* but return an error... */
return(1); /* but return an error... */
}
return(0); /* It's all good! */
#endif
......
......@@ -241,8 +241,8 @@ static void _ftb_init_index_search(FT_INFO *ftb)
{
if (!is_tree_inited(& ftb->no_dupes))
{
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
_ftb_no_dupes_cmp,0,0,0);
init_tree(&ftb->no_dupes,0,0,sizeof(my_off_t),
_ftb_no_dupes_cmp, 0, NULL, NULL);
}
}
}
......
......@@ -41,8 +41,8 @@ int ft_init_stopwords(const char **sws)
if(!stopwords3)
{
if(!(stopwords3=(TREE *)my_malloc(sizeof(TREE),MYF(0)))) return -1;
init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp,0,
NULL, NULL);
init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp,
0, NULL, NULL);
}
if(!sws) return 0;
......
......@@ -1771,7 +1771,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
File new_file;
MI_SORT_PARAM sort_param;
MYISAM_SHARE *share=info->s;
MI_KEYSEG *keyseg;
HA_KEYSEG *keyseg;
ulong *rec_per_key_part;
char llbuff[22];
SORT_INFO sort_info;
......@@ -2136,7 +2136,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
MI_SORT_PARAM *sort_param=0;
MYISAM_SHARE *share=info->s;
ulong *rec_per_key_part;
MI_KEYSEG *keyseg;
HA_KEYSEG *keyseg;
char llbuff[22];
IO_CACHE_SHARE io_share;
SORT_INFO sort_info;
......@@ -3080,7 +3080,7 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
{
sort_info->dupp++;
sort_info->info->lastpos=get_record_for_key(sort_info->info,
sort_parm->keyinfo,
sort_param->keyinfo,
(uchar*) a);
mi_check_print_warning(param,
"Duplicate key for record at %10s against record at %10s",
......
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