PROJECT INDEX - UDF LIB HOME

MySQL UDF & Plugin Library

(String user defined functions library)
Introduction :

LibString Is an attempt to provide improved string processing functionality to the MySQL Server,.
Installation :

There are only a few steps you have to follow, or refer to how to install udf lib :

Requirements :

No Requirements is needed.

This extension makes use of the BString. Better String library is an attempt to provide improved string processing functionality to the C and C++ language. At the heart of the bstring library (Bstrlib for short) is the management of "bstring"s which are a significant improvement over '\0' terminated char buffers.

List of functions:
str_mid , str_del , str_concat , str_nconcat , str_cmp , str_ncmp , str_icmp , str_incmp , str_set , str_set , str_cinsert , str_replace , str_ireplace , str_lreplace , str_trunc , str_repeate , str_tu , str_tl , str_ltrim , str_rtrim , str_trim , str_cformat
string str_mid STRING str_mid( STRING b, INT left, INT len )
Function name str_mid
Purpose Create a string which is the substring of b starting from position left and running for a length len (clamped by the end of the string b.)
Aggregate function No
Input parameter(s) 3
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_mid RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_mid;
goto top

STRING str_del( STRING b, INT pos, INT len )
Function name str_del
Purpose Removes characters from pos to pos+len-1 and shifts the tail of the string starting from pos+len to pos.
Aggregate function No
Input parameter(s) 3
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_del RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_del ;
goto top

STRING str_concat(STRING a, STRING b)
Function name str_concat
Purpose Concatenate the string a to the end of string b.
Aggregate function No
Input parameter(s) 2
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_concat RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_concat ;
goto top

STRING str_nconcat(STRING a, STRING b, INT len )
Function name str_nconcat
Purpose Concatenate a fixed length buffer (s, len) to the end of string a
Aggregate function No
Input parameter(s) 3
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_nconcat RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_nconcat ;
goto top

INT str_cmp(STRING a, STRING b )
Function name str_cmp
Purpose Compare the strings a and b for ordering.
Aggregate function No
Input parameter(s) 2
Output value(s) 1 (INTEGER)
Registration CREATE FUNCTION str_cmp RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_cmp ;
goto top

INT str_ncmp(STRING a, STRING b, INT len )
Function name str_ncmp
Purpose Compare the strings a and b for at most n characters.
Aggregate function No
Input parameter(s) 3
Output value(s) 1 (INTEGER)
Registration CREATE FUNCTION str_ncmp RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_ncmp ;
goto top

INT str_icmp(STRING a, STRING b )
Function name str_icmp
Purpose Compare two strings without differentiating between case.
Aggregate function No
Input parameter(s) 2
Output value(s) 1 (INTEGER)
Registration CREATE FUNCTION str_icmp RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_icmp ;
goto top

INT str_incmp(STRING a, STRING b, INT len )
Function name str_incmp
Purpose Compare two strings without differentiating between case for at most n characters.
Aggregate function No
Input parameter(s) 3
Output value(s) 1 (INTEGER)
Registration CREATE FUNCTION str_incmp RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_incmp ;
goto top

STRING str_set (STRING a, INT pos, STRING b, CHAR fill)
Function name str_set
Purpose Overwrite the string A starting at position pos with the bstring B
Aggregate function No
Input parameter(s) 4
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_set RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_set ;
goto top

STRING str_insert(STRING a, INT pos, STRING b, CHAR fill )
Function name str_set
Purpose Inserts the string B into A at position pos.
Aggregate function No
Input parameter(s) 4
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_insert RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_insert ;
goto top

STRING str_cinsert(STRING a, INT pos, INT len,CHAR fill )
Function name str_cinsert
Purpose Inserts the character fill repeatedly into A at position pos for a length len.
Aggregate function No
Input parameter(s) 4
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_cinsert RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_cinsert ;
goto top

STRING str_replace(STRING result, STRING find, STRING replace, INT pos )
Function name str_replace
Purpose Replace all occurrences of the find substring with a replace string after a given position in the string B.
Aggregate function No
Input parameter(s) 4
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_replace RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_replace ;
goto top

STRING str_ireplace(STRING STR, STRING find, STRING replace, INT pos )
Function name str_ireplace
Purpose
Replace all occurrences of the find substring, ignoring case, with a replace string after a given position in the string STR.
Aggregate function No
Input parameter(s) 4
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_ireplace RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_ireplace ;
goto top

STRING str_lreplace(STRING a, INT pos, INT len, STRING b, CHAR fill )
Function name str_lreplace
Purpose Replace a section of a string from pos for a length len with the string B
Aggregate function No
Input parameter(s) 5
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_lreplace RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_lreplace ;
goto top

STRING str_trunc( STRING a, INT n )
Function name str_trunc
Purpose Truncate the string to at most n characters.
Aggregate function No
Input parameter(s) 2
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_trunc RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_trunc ;
goto top

STRING str_repeate( STRING a, INT len )
Function name str_repeate
Purpose replicate the starting string b, end to end repeatedly until it surpasses len characters, then chop the result to exactly len characters.
Aggregate function No
Input parameter(s) 2
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_repeate RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_repeate ;
goto top

STRING str_tu( STRING a )
Function name str_tu
Purpose Convert contents of string to upper case.
Aggregate function No
Input parameter(s) 1
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_tu RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_tu ;
goto top

STRING str_tl( STRING a )
Function name str_tl
Purpose Convert contents of string to lower case.
Aggregate function No
Input parameter(s) 1
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_tl RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_tl ;
goto top

STRING str_ltrim( STRING a )
Function name str_ltrim
Purpose Delete whitespace contiguous from the left end of the string.
Aggregate function No
Input parameter(s) 1
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_ltrim RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_ltrim ;
goto top

STRING str_ltrim( STRING a )
Function name str_rtrim
Purpose Delete whitespace contiguous from the right end of the string.
Aggregate function No
Input parameter(s) 1
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_rtrim RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_rtrim ;
goto top

STRING str_trim( STRING a )
Function name str_trim
Purpose Delete whitespace contiguous from both ends of the string.
Aggregate function No
Input parameter(s) 1
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_trim RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_trim ;
goto top

STRING str_cformat( STRING a, STRING|REAL|INTEGER b )
Function name str_cformat
Purpose Takes the same parameters as printf (), but rather than outputting results to stdio, it forms a string which contains what would have been output. Note that if there is an early generation of a '\0' character, the string will be truncated to this end point.
Aggregate function No
Input parameter(s) 1
Output value(s) 1 (STRING)
Registration CREATE FUNCTION str_cformat RETURNS STRING SONAME "libstring.so";
UNINSTALL DROP FUNCTION IF EXISTS str_cformat ;
goto top


INDEX - TOP - CONTACT