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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
03c68f40
Commit
03c68f40
authored
Aug 31, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ErrConvStringQ helper
like ErrConvString, but puts the string in 'single quotes'
parent
3c9ecf4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
sql/sql_error.h
sql/sql_error.h
+19
-0
No files found.
sql/sql_error.h
View file @
03c68f40
...
...
@@ -857,6 +857,14 @@ class ErrBuff
len
=
err_conv
(
err_buffer
,
(
uint
)
sizeof
(
err_buffer
),
str
,
(
uint
)
len
,
cs
);
return
{
err_buffer
,
len
};
}
LEX_CSTRING
set_strq
(
const
char
*
str
,
size_t
len
,
CHARSET_INFO
*
cs
)
const
{
DBUG_ASSERT
(
len
<
UINT_MAX32
);
len
=
err_conv
(
err_buffer
+
1
,
(
uint
)
sizeof
(
err_buffer
)
-
2
,
str
,
(
uint
)
len
,
cs
);
err_buffer
[
0
]
=
err_buffer
[
len
+
1
]
=
'\''
;
err_buffer
[
len
+
2
]
=
0
;
return
{
err_buffer
,
len
+
2
};
}
LEX_CSTRING
set_mysql_time
(
const
MYSQL_TIME
*
ltime
)
const
{
int
length
=
my_TIME_to_str
(
ltime
,
err_buffer
,
AUTO_SEC_PART_DIGITS
);
...
...
@@ -880,6 +888,7 @@ class ErrConv: public ErrBuff
class
ErrConvString
:
public
ErrConv
{
protected:
const
char
*
str
;
size_t
len
;
CHARSET_INFO
*
cs
;
...
...
@@ -896,6 +905,16 @@ class ErrConvString : public ErrConv
}
};
class
ErrConvStringQ
:
public
ErrConvString
{
public:
using
ErrConvString
::
ErrConvString
;
LEX_CSTRING
lex_cstring
()
const
override
{
return
set_strq
(
str
,
len
,
cs
);
}
};
class
ErrConvInteger
:
public
ErrConv
,
public
Longlong_hybrid
{
public:
...
...
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