diff options
author | monty@narttu.mysql.fi <> | 2003-06-04 18:28:51 +0300 |
---|---|---|
committer | monty@narttu.mysql.fi <> | 2003-06-04 18:28:51 +0300 |
commit | 23145cfed72954c29f5a47e82af22898164be4b0 (patch) | |
tree | f2e86edc169afb1fed9cecefdecd9f13561780c9 /libmysqld/libmysqld.c | |
parent | 7df5635ff2845bd708711f6b790997a3c68d5f2a (diff) | |
download | mariadb-git-23145cfed72954c29f5a47e82af22898164be4b0.tar.gz |
Added SQLSTATE to client/server protocol
bmove_allign -> bmove_align
Added OLAP function ROLLUP
Split mysql_fix_privilege_tables to a script and a .sql data file
Added new (MEMROOT*) functions to avoid calling current_thd() when creating some common objects.
Added table_alias_charset, for easier --lower-case-table-name handling
Better SQL_MODE handling (Setting complex options also sets sub options)
New (faster) assembler string functions for x86
Diffstat (limited to 'libmysqld/libmysqld.c')
-rw-r--r-- | libmysqld/libmysqld.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index e6166f6bbe5..a2d69b30c0d 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -450,6 +450,7 @@ static inline int mysql_init_charset(MYSQL *mysql) if (!mysql->charset) { mysql->last_errno=CR_CANT_READ_CHARSET; + strmov(mysql->sqlstate, "HY0000"); if (mysql->options.charset_dir) sprintf(mysql->last_error,ER(mysql->last_errno), charset_name ? charset_name : "unknown", @@ -1130,6 +1131,7 @@ mysql_stat(MYSQL *mysql) if (!mysql->net.read_pos[0]) { mysql->net.last_errno=CR_WRONG_HOST_INFO; + strmov(mysql->sqlstate, unknown_sqlstate); strmov(mysql->net.last_error, ER(mysql->net.last_errno)); return mysql->net.last_error; } @@ -1284,12 +1286,12 @@ unsigned int STDCALL mysql_field_count(MYSQL *mysql) my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql) { - return (mysql)->affected_rows; + return mysql->affected_rows; } my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql) { - return (mysql)->insert_id; + return mysql->insert_id; } uint STDCALL mysql_errno(MYSQL *mysql) @@ -1297,6 +1299,11 @@ uint STDCALL mysql_errno(MYSQL *mysql) return mysql->last_errno; } +const char *STDCALL mysql_sqlstate(MYSQL *mysql) +{ + return mysql->sqlstate; +} + const char * STDCALL mysql_error(MYSQL *mysql) { return mysql->last_error; |