20
20
#include "config.h"
22
#include <drizzled/function/str/quote.h>
27
#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))
28
static uint32_t get_esc_bit(unsigned char *mask, unsigned char num)
30
return (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7));
30
QUOTE() function returns argument string in single quotes suitable for
31
using in a SQL statement.
33
Adds a \\ before all characters that needs to be escaped in a SQL string.
34
We also escape '^Z' (END-OF-FILE in windows) to avoid probelms when
35
running commands from a file in windows.
37
This function is very useful when you want to generate SQL statements.
40
QUOTE(NULL) returns the string 'NULL' (4 letters, without quotes).
35
* Returns the argument string in single quotes suitable for using in a SQL statement.
38
* Adds a \\ before all characters that needs to be escaped in a SQL string.
39
* We also escape '^Z' (END-OF-FILE in windows) to avoid problems when
40
* running commands from a file in windows.
42
* This function is very useful when you want to generate SQL statements.
45
* val_str(NULL) returns the string 'NULL' (4 letters, without quotes).
47
* @retval str Quoted string
48
* @retval NULL Out of memory.
48
50
String *Item_func_quote::val_str(String *str)
50
52
assert(fixed == 1);