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
39067890
Commit
39067890
authored
Aug 09, 2002
by
ram@ram.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added NULLs check to the QUOTE() function
parent
eebad763
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
sql/item_strfunc.cc
sql/item_strfunc.cc
+8
-4
No files found.
sql/item_strfunc.cc
View file @
39067890
...
@@ -2085,16 +2085,16 @@ String *Item_func_quote::val_str(String *str)
...
@@ -2085,16 +2085,16 @@ String *Item_func_quote::val_str(String *str)
char
*
from
,
*
to
,
*
end
;
char
*
from
,
*
to
,
*
end
;
uint
delta
=
2
;
/* for beginning and ending ' signs */
uint
delta
=
2
;
/* for beginning and ending ' signs */
if
(
!
arg
)
goto
null
;
for
(
from
=
(
char
*
)
arg
->
ptr
(),
end
=
from
+
arg
->
length
();
from
<
end
;
from
++
)
for
(
from
=
(
char
*
)
arg
->
ptr
(),
end
=
from
+
arg
->
length
();
from
<
end
;
from
++
)
{
{
if
(
*
(
escmask
+
(
*
from
>>
3
))
and
(
1
<<
(
*
from
&
7
)))
if
(
*
(
escmask
+
(
*
from
>>
3
))
and
(
1
<<
(
*
from
&
7
)))
delta
++
;
delta
++
;
}
}
if
(
str
->
alloc
(
arg
->
length
()
+
delta
))
if
(
str
->
alloc
(
arg
->
length
()
+
delta
))
{
goto
null
;
null_value
=
1
;
return
0
;
}
to
=
(
char
*
)
str
->
ptr
()
+
arg
->
length
()
+
delta
-
1
;
to
=
(
char
*
)
str
->
ptr
()
+
arg
->
length
()
+
delta
-
1
;
*
to
--=
'\''
;
*
to
--=
'\''
;
for
(
end
=
(
char
*
)
arg
->
ptr
(),
from
=
end
+
arg
->
length
()
-
1
;
from
>=
end
;
for
(
end
=
(
char
*
)
arg
->
ptr
(),
from
=
end
+
arg
->
length
()
-
1
;
from
>=
end
;
...
@@ -2107,4 +2107,8 @@ String *Item_func_quote::val_str(String *str)
...
@@ -2107,4 +2107,8 @@ String *Item_func_quote::val_str(String *str)
*
to
=
'\''
;
*
to
=
'\''
;
str
->
length
(
arg
->
length
()
+
delta
);
str
->
length
(
arg
->
length
()
+
delta
);
return
str
;
return
str
;
null:
null_value
=
1
;
return
0
;
}
}
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