Loading Docs/manual.texi +18 −0 Original line number Diff line number Diff line Loading @@ -30076,6 +30076,15 @@ mysql> select OCTET_LENGTH('text'); Note that for @code{CHAR_LENGTH()}, multi-byte characters are only counted once. @findex BIT_LENGTH() @item BIT_LENGTH(str) Returns the length of the string @code{str} in bits: @example mysql> select BIT_LENGTH('text'); -> 32 @end example @findex LOCATE() @findex POSITION() @item LOCATE(substr,str) Loading Loading @@ -47893,10 +47902,19 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @cindex changes, version 4.0 @menu * News-4.0.2:: Changes in release 4.0.2 * News-4.0.1:: Changes in release 4.0.1 * News-4.0.0:: Changes in release 4.0.0 @end menu @node News-4.0.2, News-4.0.1, News-4.0.x, News-4.0.x @appendixsubsec Changes in release 4.0.2 @itemize @bullet @item ODBC compatibility: added @code{BIT_LENGTH()} function. @end itemize @node News-4.0.1, News-4.0.0, News-4.0.x, News-4.0.x @appendixsubsec Changes in release 4.0.1 mysql-test/r/func_str.result +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ hellomonty select length('\n\t\r\b\0\_\%\\'); length('\n\t\r\b\0\_\%\\') 10 select bit_length('\n\t\r\b\0\_\%\\'); bit_length('\n\t\r\b\0\_\%\\') 80 select concat('monty',' was here ','again'),length('hello'),char(ascii('h')); concat('monty',' was here ','again') length('hello') char(ascii('h')) monty was here again 5 h Loading mysql-test/t/func_str.test +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ drop table if exists t1; select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; select 'hello' 'monty'; select length('\n\t\r\b\0\_\%\\'); select bit_length('\n\t\r\b\0\_\%\\'); select concat('monty',' was here ','again'),length('hello'),char(ascii('h')); select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); Loading sql/item_create.cc +5 −0 Original line number Diff line number Diff line Loading @@ -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); Loading sql/item_create.h +1 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
Docs/manual.texi +18 −0 Original line number Diff line number Diff line Loading @@ -30076,6 +30076,15 @@ mysql> select OCTET_LENGTH('text'); Note that for @code{CHAR_LENGTH()}, multi-byte characters are only counted once. @findex BIT_LENGTH() @item BIT_LENGTH(str) Returns the length of the string @code{str} in bits: @example mysql> select BIT_LENGTH('text'); -> 32 @end example @findex LOCATE() @findex POSITION() @item LOCATE(substr,str) Loading Loading @@ -47893,10 +47902,19 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @cindex changes, version 4.0 @menu * News-4.0.2:: Changes in release 4.0.2 * News-4.0.1:: Changes in release 4.0.1 * News-4.0.0:: Changes in release 4.0.0 @end menu @node News-4.0.2, News-4.0.1, News-4.0.x, News-4.0.x @appendixsubsec Changes in release 4.0.2 @itemize @bullet @item ODBC compatibility: added @code{BIT_LENGTH()} function. @end itemize @node News-4.0.1, News-4.0.0, News-4.0.x, News-4.0.x @appendixsubsec Changes in release 4.0.1
mysql-test/r/func_str.result +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ hellomonty select length('\n\t\r\b\0\_\%\\'); length('\n\t\r\b\0\_\%\\') 10 select bit_length('\n\t\r\b\0\_\%\\'); bit_length('\n\t\r\b\0\_\%\\') 80 select concat('monty',' was here ','again'),length('hello'),char(ascii('h')); concat('monty',' was here ','again') length('hello') char(ascii('h')) monty was here again 5 h Loading
mysql-test/t/func_str.test +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ drop table if exists t1; select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; select 'hello' 'monty'; select length('\n\t\r\b\0\_\%\\'); select bit_length('\n\t\r\b\0\_\%\\'); select concat('monty',' was here ','again'),length('hello'),char(ascii('h')); select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); Loading
sql/item_create.cc +5 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
sql/item_create.h +1 −0 Original line number Diff line number Diff line Loading @@ -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); Loading