diff options
author | unknown <serg@janus.mylan> | 2007-11-19 17:12:49 +0100 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2007-11-19 17:12:49 +0100 |
commit | f437a65fb5dad5b2f7a0042cbb715a83c5a0886e (patch) | |
tree | 8658b1da8e7d5771ffd198af5aa8538e9b675fb2 /sql/sql_class.h | |
parent | 38591bca76f3e90fe32dc9661cedd01891574c92 (diff) | |
parent | f4f7e1f42c831152d750a0f159db7bae1b756601 (diff) | |
download | mariadb-git-f437a65fb5dad5b2f7a0042cbb715a83c5a0886e.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into janus.mylan:/usr/home/serg/Abk/mysql-5.1
BitKeeper/etc/ignore:
auto-union
client/mysqldump.c:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
tests/mysql_client_test.c:
Auto merged
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 68 |
1 files changed, 59 insertions, 9 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index b12cd1beaf5..f09759ddde6 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -969,6 +969,7 @@ public: @return true if the error is handled */ virtual bool handle_error(uint sql_errno, + const char *message, MYSQL_ERROR::enum_warning_level level, THD *thd) = 0; }; @@ -1363,9 +1364,20 @@ public: ulonglong limit_found_rows; ulonglong options; /* Bitmap of states */ - longlong row_count_func; /* For the ROW_COUNT() function */ - ha_rows cuted_fields, - sent_row_count, examined_row_count; + longlong row_count_func; /* For the ROW_COUNT() function */ + ha_rows cuted_fields; + + /* + number of rows we actually sent to the client, including "synthetic" + rows in ROLLUP etc. + */ + ha_rows sent_row_count; + + /* + number of rows we read, sent or not, including in create_sort_index() + */ + ha_rows examined_row_count; + /* The set of those tables whose fields are referenced in all subqueries of the query. @@ -1401,7 +1413,11 @@ public: /* Statement id is thread-wide. This counter is used to generate ids */ ulong statement_id_counter; ulong rand_saved_seed1, rand_saved_seed2; - ulong row_count; // Row counter, mainly for errors and warnings + /* + Row counter, mainly for errors and warnings. Not increased in + create_sort_index(); may differ from examined_row_count. + */ + ulong row_count; pthread_t real_id; /* For debugging */ my_thread_id thread_id; uint tmp_table, global_read_lock; @@ -1464,7 +1480,14 @@ public: /* for IS NULL => = last_insert_id() fix in remove_eq_conds() */ bool substitute_null_with_insert_id; bool in_lock_tables; - bool query_error, bootstrap, cleanup_done; + /** + True if a slave error. Causes the slave to stop. Not the same + as the statement execution error (is_error()), since + a statement may be expected to return an error, e.g. because + it returned an error on master, and this is OK on the slave. + */ + bool is_slave_error; + bool bootstrap, cleanup_done; /** is set if some thread specific value(s) used in a statement. */ bool thread_specific_used; @@ -1693,7 +1716,7 @@ public: net.last_error[0]= 0; net.last_errno= 0; net.report_error= 0; - query_error= 0; + is_slave_error= 0; DBUG_VOID_RETURN; } inline bool vio_ok() const { return net.vio != 0; } @@ -1707,6 +1730,20 @@ public: net.report_error= 1; DBUG_PRINT("error",("Fatal error set")); } + /** + TRUE if there is an error in the error stack. + + Please use this method instead of direct access to + net.report_error. + + If TRUE, the current (sub)-statement should be aborted. + The main difference between this member and is_fatal_error + is that a fatal error can not be handled by a stored + procedure continue handler, whereas a normal error can. + + To raise this flag, use my_error(). + */ + inline bool is_error() const { return net.report_error; } inline CHARSET_INFO *charset() { return variables.character_set_client; } void update_charset(); @@ -1900,7 +1937,7 @@ public: @param level the error level @return true if the error is handled */ - virtual bool handle_error(uint sql_errno, + virtual bool handle_error(uint sql_errno, const char *message, MYSQL_ERROR::enum_warning_level level); /** @@ -2027,14 +2064,20 @@ public: class select_send :public select_result { - int status; + /** + True if we have sent result set metadata to the client. + In this case the client always expects us to end the result + set with an eof or error packet + */ + bool is_result_set_started; public: - select_send() :status(0) {} + select_send() :is_result_set_started(FALSE) {} bool send_fields(List<Item> &list, uint flags); bool send_data(List<Item> &items); bool send_eof(); virtual bool check_simple_select() const { return FALSE; } void abort(); + virtual void cleanup(); }; @@ -2068,6 +2111,7 @@ public: class select_export :public select_to_file { uint field_term_length; int field_sep_char,escape_char,line_sep_char; + int field_term_char; // first char of FIELDS TERMINATED BY or MAX_INT /* The is_ambiguous_field_sep field is true if a value of the field_sep_char field is one of the 'n', 't', 'r' etc characters @@ -2075,6 +2119,12 @@ class select_export :public select_to_file { */ bool is_ambiguous_field_sep; /* + The is_ambiguous_field_term is true if field_sep_char contains the first + char of the FIELDS TERMINATED BY (ENCLOSED BY is empty), and items can + contain this character. + */ + bool is_ambiguous_field_term; + /* The is_unsafe_field_sep field is true if a value of the field_sep_char field is one of the '0'..'9', '+', '-', '.' and 'e' characters (see the NUMERIC_CHARS constant value). |