summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-06-14 11:37:42 +0300
committerunknown <monty@narttu.mysql.fi>2003-06-14 11:37:42 +0300
commitccf59c3874df6b260f613afe0a097a555b4ba642 (patch)
treef247f6e12388923f7fa5395b19d69e2dc62dbcd1 /include
parent0826127b2b826871fb3dcf1a1497d364d62da3b9 (diff)
downloadmariadb-git-ccf59c3874df6b260f613afe0a097a555b4ba642.tar.gz
Cleanup after split of libmysql.c to client.c and libmysql.c. A 4.1 master/slave will now use the 4.1 protocol
Fixed wrong value for SQLSTATE_LENGTH Added CLIENT_REMEMBER_OPTIONS to mysql_real_connect() Changed mysql_port and mysql_unix_port to mysqld_xxxx client/mysql.cc: Removed valgrind & compiler warnings client/sql_string.h: Fix to remove valgrind warnings include/mysql.h: Added read_timeout and write_timeout to mysql options struct. This is to be used for slave when connection to master. code cleanup include/mysql_com.h: Fixed wrong value for SQLSTATE_LENGTH Added CLIENT_REMEMBER_OPTIONS include/sql_common.h: Cleanup after split of libmysql.c to client.c and libmysql.c include/sql_state.h: Removed default states libmysql/client_settings.h: Cleanup after split of libmysql.c to client.c and libmysql.c libmysql/libmysql.c: Cleanup after split of libmysql.c to client.c and libmysql.c mysql-test/r/type_blob.result: Update results after someone updated error messages without running tests mysys/charset.c: More debug information mysys/errors.c: Fixed wrong error message sql-common/client.c: Cleanup after split of libmysql.c to client.c and libmysql.c sql/Makefile.am: Added sql_client.cc sql/client_settings.h: Cleanup after split of libmysql.c to client.c and libmysql.c sql/log.cc: Changed mysql_port and mysql_unix_port to mysqld_xxxx sql/mysql_priv.h: Changed mysql_port and mysql_unix_port to mysqld_xxxx sql/mysqld.cc: Changed mysql_port and mysql_unix_port to mysqld_xxxx sql/protocol.cc: Fix for SQLSTATE_LENGTH Moved function to sql_client.c sql/repl_failsafe.cc: Cleanup after split of libmysql.c to client.c and libmysql.c sql/set_var.cc: Changed mysql_port and mysql_unix_port to mysqld_xxxx sql/slave.cc: Cleanup after split of libmysql.c to client.c and libmysql.c
Diffstat (limited to 'include')
-rw-r--r--include/mysql.h22
-rw-r--r--include/mysql_com.h3
-rw-r--r--include/sql_common.h4
-rw-r--r--include/sql_state.h3
4 files changed, 12 insertions, 20 deletions
diff --git a/include/mysql.h b/include/mysql.h
index 374ac9b8959..337e080e4cc 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -135,9 +135,9 @@ typedef struct st_mysql_data {
} MYSQL_DATA;
struct st_mysql_options {
- unsigned int connect_timeout;
+ unsigned int connect_timeout, read_timeout, write_timeout;
+ unsigned int port, protocol;
unsigned long client_flag;
- unsigned int port;
char *host,*user,*password,*unix_socket,*db;
struct st_dynamic_array *init_commands;
char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
@@ -146,6 +146,7 @@ struct st_mysql_options {
char *ssl_ca; /* PEM CA file */
char *ssl_capath; /* PEM directory of CA-s? */
char *ssl_cipher; /* cipher to use */
+ char *shared_memory_base_name;
unsigned long max_allowed_packet;
my_bool use_ssl; /* if to use SSL or not */
my_bool compress,named_pipe;
@@ -167,18 +168,15 @@ struct st_mysql_options {
#ifdef EMBEDDED_LIBRARY
my_bool separate_thread;
#endif
- char *shared_memory_base_name;
- unsigned int protocol;
};
enum mysql_option
{
- MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND,
- MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME,
- MYSQL_OPT_LOCAL_INFILE, MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME
-#ifdef EMBEDDED_LIBRARY
- , MYSQL_OPT_USE_RESULT
-#endif
+ MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
+ MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
+ MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
+ MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
+ MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT
};
enum mysql_status
@@ -188,8 +186,8 @@ enum mysql_status
enum mysql_protocol_type
{
- MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE,
- MYSQL_PROTOCOL_MEMORY
+ MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
+ MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
/*
There are three types of queries - the ones that have to go to
diff --git a/include/mysql_com.h b/include/mysql_com.h
index faa025c934e..e87001ff27d 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -25,7 +25,7 @@
#define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16
#define SERVER_VERSION_LENGTH 60
-#define SQLSTATE_LENGTH 6
+#define SQLSTATE_LENGTH 5
#define LOCAL_HOST "localhost"
#define LOCAL_HOST_NAMEDPIPE "."
@@ -110,6 +110,7 @@ enum enum_server_command
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_QUERIES 65536 /* Enable/disable multiquery support */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
+#define CLIENT_REMEMBER_OPTIONS (1L << 31)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
diff --git a/include/sql_common.h b/include/sql_common.h
index 65283486fb4..f3300281f29 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -42,9 +42,5 @@ my_bool mysql_reconnect(MYSQL *mysql);
}
#endif
-#ifdef MYSQL_SERVER
-#define protocol_41(A) FALSE
-#else
#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)
-#endif
diff --git a/include/sql_state.h b/include/sql_state.h
index cc0fab7bfce..c998beaf578 100644
--- a/include/sql_state.h
+++ b/include/sql_state.h
@@ -86,7 +86,6 @@ ER_UNSUPPORTED_EXTENSION, "42000", "",
ER_TABLE_MUST_HAVE_COLUMNS, "42000", "",
ER_UNKNOWN_CHARACTER_SET, "42000", "",
ER_TOO_BIG_ROWSIZE, "42000", "",
-ER_STACK_OVERRUN, "HY000", "",
ER_WRONG_OUTER_JOIN, "42000", "",
ER_NULL_COLUMN_IN_INDEX, "42000", "",
ER_PASSWORD_ANONYMOUS_USER, "42000", "",
@@ -128,8 +127,6 @@ ER_REQUIRES_PRIMARY_KEY, "42000", "",
ER_CHECK_NO_SUCH_TABLE, "42000", "",
ER_CHECK_NOT_IMPLEMENTED, "42000", "",
ER_CANT_DO_THIS_DURING_AN_TRANSACTION, "25000", "",
-ER_ERROR_DURING_COMMIT, "HY000", "",
-ER_ERROR_DURING_ROLLBACK, "HY000", "",
ER_NEW_ABORTING_CONNECTION, "08S01", "",
ER_MASTER_NET_READ, "08S01", "",
ER_MASTER_NET_WRITE, "08S01", "",