diff options
author | serg@serg.mysql.com <> | 2002-01-03 20:00:45 +0000 |
---|---|---|
committer | serg@serg.mysql.com <> | 2002-01-03 20:00:45 +0000 |
commit | 5f1599e4b4b04b40a52e5c57796cdb6e61d2871d (patch) | |
tree | e7eeb4836aa90bdd94af9eefffeca93a16137b5c /sql | |
parent | fd81437a6b91b28fd89aca4dedffa5f5d7e6e685 (diff) | |
parent | ef8436beffb8f9aac4fc646627661539dad61911 (diff) | |
download | mariadb-git-5f1599e4b4b04b40a52e5c57796cdb6e61d2871d.tar.gz |
merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_create.cc | 5 | ||||
-rw-r--r-- | sql/item_create.h | 1 | ||||
-rw-r--r-- | sql/item_func.h | 8 | ||||
-rw-r--r-- | sql/lex.h | 1 | ||||
-rw-r--r-- | sql/sql_handler.cc | 5 |
5 files changed, 20 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 4b60ad1bf56..6f64e9517ba 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -200,6 +200,11 @@ Item *create_func_length(Item* a) return new Item_func_length(a); } +Item *create_func_bit_length(Item* a) +{ + return new Item_func_bit_length(a); +} + Item *create_func_char_length(Item* a) { return new Item_func_char_length(a); diff --git a/sql/item_create.h b/sql/item_create.h index 9318025cae8..580596505da 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -22,6 +22,7 @@ Item *create_func_ascii(Item* a); Item *create_func_asin(Item* a); Item *create_func_bin(Item* a); Item *create_func_bit_count(Item* a); +Item *create_func_bit_length(Item* a); Item *create_func_ceiling(Item* a); Item *create_func_char_length(Item* a); Item *create_func_connection_id(void); diff --git a/sql/item_func.h b/sql/item_func.h index 91fd6cdcc26..f7794028998 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -522,6 +522,14 @@ public: void fix_length_and_dec() { max_length=10; } }; +class Item_func_bit_length :public Item_func_length +{ +public: + Item_func_bit_length(Item *a) :Item_func_length(a) {} + longlong val_int() { return Item_func_length::val_int()*8; } + const char *func_name() const { return "bit_length"; } +}; + class Item_func_char_length :public Item_int_func { String value; diff --git a/sql/lex.h b/sql/lex.h index c2664e4e8c0..c9382275f0e 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -396,6 +396,7 @@ static SYMBOL sql_functions[] = { { "BIT_AND", SYM(BIT_AND),0,0}, { "CAST", SYM(CAST_SYM),0,0}, { "CEILING", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)}, + { "BIT_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)}, { "CHAR_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)}, { "CHARACTER_LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)}, { "COALESCE", SYM(COALESCE),0,0}, diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index f7effdc67e6..0c6b5599519 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -130,7 +130,11 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, select_limit+=offset_limit; send_fields(thd,list,1); + HANDLER_TABLES_HACK(thd); MYSQL_LOCK *lock=mysql_lock_tables(thd,&tables->table,1); + HANDLER_TABLES_HACK(thd); + if (!lock) + goto err0; // mysql_lock_tables() printed error message already for (uint num_rows=0; num_rows < select_limit; ) { @@ -238,6 +242,7 @@ ok: return 0; err: mysql_unlock_tables(thd,lock); +err0: return -1; } |