Needed for WL# 2094, MySQL Federated Storage Handler

sql_string.h:
  simple string method to drop last character of a string (also decrements str_length)
parent 31493800
...@@ -156,6 +156,7 @@ nick@mysql.com ...@@ -156,6 +156,7 @@ nick@mysql.com
nick@nick.leippe.com nick@nick.leippe.com
papa@gbichot.local papa@gbichot.local
patg@krsna.patg.net patg@krsna.patg.net
patg@patrick-galbraiths-computer.local
paul@central.snake.net paul@central.snake.net
paul@ice.local paul@ice.local
paul@ice.snake.net paul@ice.snake.net
......
...@@ -141,6 +141,34 @@ class String ...@@ -141,6 +141,34 @@ class String
bool set(longlong num, CHARSET_INFO *cs); bool set(longlong num, CHARSET_INFO *cs);
bool set(ulonglong num, CHARSET_INFO *cs); bool set(ulonglong num, CHARSET_INFO *cs);
bool set(double num,uint decimals, CHARSET_INFO *cs); bool set(double num,uint decimals, CHARSET_INFO *cs);
/*
PMG 2004.11.12
This is a method that works the same as perl's "chop". It simply
drops the last character of a string. This is useful in the case
of the federated storage handler where I'm building a unknown
number, list of values and fields to be used in a sql insert
statement to be run on the remote server, and have a comma after each.
When the list is complete, I "chop" off the trailing comma
ex.
String stringobj;
stringobj.append("VALUES ('foo', 'fi', 'fo',");
stringobj.chop();
stringobj.append(")");
In this case, the value of string was:
VALUES ('foo', 'fi', 'fo',
VALUES ('foo', 'fi', 'fo'
VALUES ('foo', 'fi', 'fo')
*/
inline void chop()
{
Ptr[str_length--]= '\0';
}
inline void free() inline void free()
{ {
if (alloced) if (alloced)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment