Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
55700042
Commit
55700042
authored
5 years ago
by
Cedric CAFFY
Committed by
Cedric Caffy
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adapted MysqlStmt.cpp so that it honours the MYSQL_TYPE_LONG_BLOB data type
parent
c0197ddf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rdbms/wrapper/MysqlStmt.cpp
+14
-14
14 additions, 14 deletions
rdbms/wrapper/MysqlStmt.cpp
with
14 additions
and
14 deletions
rdbms/wrapper/MysqlStmt.cpp
+
14
−
14
View file @
55700042
...
...
@@ -362,23 +362,22 @@ void MysqlStmt::bindString(const std::string ¶mName, const optional<std::str
const
unsigned
int
paramIdx
=
getParamIdx
(
paramName
);
// starts from 1.
const
unsigned
int
idx
=
paramIdx
-
1
;
Mysql
::
Placeholder_String
*
holder
=
dynamic_cast
<
Mysql
::
Placeholder_String
*>
(
m_placeholder
[
idx
]);
// if already exists, try to reuse
if
(
!
holder
and
m_placeholder
[
idx
])
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" can't cast from Placeholder to Placeholder_String. "
);
}
if
(
!
holder
)
{
const
unsigned
int
buf_size
=
4096
;
holder
=
new
Mysql
::
Placeholder_String
(
buf_size
);
// hard code buffer length
holder
->
idx
=
idx
;
if
(
m_placeholder
[
idx
]){
delete
m_placeholder
[
idx
];
}
unsigned
int
buf_size
=
0
;
if
(
paramValue
){
buf_size
=
paramValue
.
value
().
size
()
+
1
;
}
Mysql
::
Placeholder_String
*
holder
=
new
Mysql
::
Placeholder_String
(
buf_size
);
// hard code buffer length
holder
->
idx
=
idx
;
if
(
paramValue
)
{
holder
->
length
=
paramValue
.
value
().
size
();
if
(
holder
->
length
>
=
holder
->
get_buffer_length
())
{
if
(
holder
->
length
>
holder
->
get_buffer_length
())
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" length >= buffer_length"
);
}
...
...
@@ -393,7 +392,7 @@ void MysqlStmt::bindString(const std::string ¶mName, const optional<std::str
holder
->
is_null
=
is_null
;
// delete m_placeholder[idx]; // remove the previous placeholder
m_placeholder
[
idx
]
=
holder
;
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" failed for SQL statement "
+
...
...
@@ -599,8 +598,9 @@ bool MysqlStmt::do_bind_results() {
case
MYSQL_TYPE_VARCHAR
:
case
MYSQL_TYPE_VAR_STRING
:
case
MYSQL_TYPE_STRING
:
case
MYSQL_TYPE_LONG_BLOB
:
{
const
unsigned
int
buf_size
=
4096
;
const
unsigned
int
buf_size
=
m_fields_info
->
maxsizes
[
i
]
+
1
;
if
(
buf_size
<
m_fields_info
->
maxsizes
[
i
])
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" buf size < m_fields_info->maxsizes["
+
std
::
to_string
(
i
)
+
"]"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment