Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
cdd1d57e
Commit
cdd1d57e
authored
Aug 09, 2002
by
ram@ram.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@work.mysql.com:/home/bk/mysql-4.0
into ram.(none):/home/ram/work/mysql-4.0
parents
214ed2f3
b43eb82b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
0 deletions
+54
-0
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
sql/item_create.cc
sql/item_create.cc
+4
-0
sql/item_create.h
sql/item_create.h
+1
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+38
-0
sql/item_strfunc.h
sql/item_strfunc.h
+9
-0
sql/lex.h
sql/lex.h
+1
-0
No files found.
BitKeeper/etc/logging_ok
View file @
cdd1d57e
...
...
@@ -73,3 +73,4 @@ worm@altair.is.lan
zak@balfor.local
zak@linux.local
zgreant@mysql.com
ram@ram.(none)
sql/item_create.cc
View file @
cdd1d57e
...
...
@@ -440,3 +440,7 @@ Item *create_func_is_free_lock(Item* a)
return
new
Item_func_is_free_lock
(
a
);
}
Item
*
create_func_quote
(
Item
*
a
)
{
return
new
Item_func_quote
(
a
);
}
sql/item_create.h
View file @
cdd1d57e
...
...
@@ -93,3 +93,4 @@ Item *create_func_weekday(Item* a);
Item
*
create_load_file
(
Item
*
a
);
Item
*
create_wait_for_master_pos
(
Item
*
a
,
Item
*
b
);
Item
*
create_func_is_free_lock
(
Item
*
a
);
Item
*
create_func_quote
(
Item
*
a
);
sql/item_strfunc.cc
View file @
cdd1d57e
...
...
@@ -2070,3 +2070,41 @@ String* Item_func_inet_ntoa::val_str(String* str)
str
->
length
(
str
->
length
()
-
1
);
// Remove last '.';
return
str
;
}
/*
QUOTE() function returns argument string in single quotes,
also adds a \ before \, ' CHAR(0) and CHAR(24)
*/
String
*
Item_func_quote
::
val_str
(
String
*
str
)
{
static
char
escmask
[
64
]
=
{
0x01
,
0x00
,
0x00
,
0x04
,
0x80
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x10
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
String
*
arg
=
args
[
0
]
->
val_str
(
str
);
char
*
from
,
*
to
,
*
end
;
uint
delta
=
2
;
/* for beginning and ending ' signs */
for
(
from
=
(
char
*
)
arg
->
ptr
(),
end
=
from
+
arg
->
length
();
from
<
end
;
from
++
)
{
if
(
*
(
escmask
+
(
*
from
>>
3
))
and
(
1
<<
(
*
from
&
7
)))
delta
++
;
}
if
(
str
->
alloc
(
arg
->
length
()
+
delta
))
{
null_value
=
1
;
return
0
;
}
to
=
(
char
*
)
str
->
ptr
()
+
arg
->
length
()
+
delta
-
1
;
*
to
--=
'\''
;
for
(
end
=
(
char
*
)
arg
->
ptr
(),
from
=
end
+
arg
->
length
()
-
1
;
from
>=
end
;
from
--
,
to
--
)
{
*
to
=
*
from
;
if
(
*
(
escmask
+
(
*
from
>>
3
))
and
(
1
<<
(
*
from
&
7
)))
*--
to
=
'\\'
;
}
*
to
=
'\''
;
str
->
length
(
arg
->
length
()
+
delta
);
return
str
;
}
sql/item_strfunc.h
View file @
cdd1d57e
...
...
@@ -526,3 +526,12 @@ public:
const
char
*
func_name
()
const
{
return
"inet_ntoa"
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
3
*
8
+
7
;
}
};
class
Item_func_quote
:
public
Item_str_func
{
public:
Item_func_quote
(
Item
*
a
)
:
Item_str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"quote"
;
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
()
{
max_length
=
args
[
0
]
->
max_length
*
2
+
2
;
}
};
sql/lex.h
View file @
cdd1d57e
...
...
@@ -475,6 +475,7 @@ static SYMBOL sql_functions[] = {
{
"POW"
,
SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC
(
create_func_pow
)},
{
"POWER"
,
SYM
(
FUNC_ARG2
),
0
,
CREATE_FUNC
(
create_func_pow
)},
{
"QUARTER"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_quarter
)},
{
"QUOTE"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_quote
)},
{
"RADIANS"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_radians
)},
{
"RAND"
,
SYM
(
RAND
),
0
,
0
},
{
"RELEASE_LOCK"
,
SYM
(
FUNC_ARG1
),
0
,
CREATE_FUNC
(
create_func_release_lock
)},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment