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
35785ed8
Commit
35785ed8
authored
Jul 26, 2012
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Plain Diff
merge 5.1 => 5.5
parents
fdaafddd
d24a78d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
client/sql_string.h
client/sql_string.h
+7
-3
sql/sql_string.h
sql/sql_string.h
+7
-3
No files found.
client/sql_string.h
View file @
35785ed8
#ifndef CLIENT_SQL_STRING_INCLUDED
#define CLIENT_SQL_STRING_INCLUDED
/* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -192,8 +192,12 @@ class String
}
bool
real_alloc
(
uint32
arg_length
);
// Empties old string
bool
realloc
(
uint32
arg_length
);
inline
void
shrink
(
uint32
arg_length
)
// Shrink buffer
// Shrink the buffer, but only if it is allocated on the heap.
inline
void
shrink
(
uint32
arg_length
)
{
if
(
!
is_alloced
())
return
;
if
(
arg_length
<
Alloced_length
)
{
char
*
new_ptr
;
...
...
@@ -209,7 +213,7 @@ class String
}
}
}
bool
is_alloced
()
{
return
alloced
;
}
bool
is_alloced
()
const
{
return
alloced
;
}
inline
String
&
operator
=
(
const
String
&
s
)
{
if
(
&
s
!=
this
)
...
...
sql/sql_string.h
View file @
35785ed8
#ifndef SQL_STRING_INCLUDED
#define SQL_STRING_INCLUDED
/* Copyright (c) 2000, 201
1
, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -235,8 +235,12 @@ class String
}
bool
real_alloc
(
uint32
arg_length
);
// Empties old string
bool
realloc
(
uint32
arg_length
);
inline
void
shrink
(
uint32
arg_length
)
// Shrink buffer
// Shrink the buffer, but only if it is allocated on the heap.
inline
void
shrink
(
uint32
arg_length
)
{
if
(
!
is_alloced
())
return
;
if
(
arg_length
<
Alloced_length
)
{
char
*
new_ptr
;
...
...
@@ -252,7 +256,7 @@ class String
}
}
}
bool
is_alloced
()
{
return
alloced
;
}
bool
is_alloced
()
const
{
return
alloced
;
}
inline
String
&
operator
=
(
const
String
&
s
)
{
if
(
&
s
!=
this
)
...
...
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