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
839b60a8
Commit
839b60a8
authored
Oct 23, 2008
by
Jonathan Perkin
Committed by
mysqldev
Oct 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge fix for bug#38296 into 5.0.66sp1
parent
317d545b
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1483 additions
and
344 deletions
+1483
-344
mysys/my_alloc.c
mysys/my_alloc.c
+1
-1
sql/field.h
sql/field.h
+2
-1
sql/item.h
sql/item.h
+2
-2
sql/sp_head.cc
sql/sp_head.cc
+1
-1
sql/sql_lex.h
sql/sql_lex.h
+2
-2
sql/sql_list.h
sql/sql_list.h
+2
-2
sql/sql_string.h
sql/sql_string.h
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+1444
-331
sql/thr_malloc.cc
sql/thr_malloc.cc
+28
-3
No files found.
mysys/my_alloc.c
View file @
839b60a8
...
...
@@ -202,7 +202,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
{
if
(
mem_root
->
error_handler
)
(
*
mem_root
->
error_handler
)();
return
((
gptr
)
0
);
/* purecov: inspected */
DBUG_RETURN
((
gptr
)
0
);
/* purecov: inspected */
}
mem_root
->
block_num
++
;
next
->
next
=
*
prev
;
...
...
sql/field.h
View file @
839b60a8
...
...
@@ -48,7 +48,8 @@ class Field
Field
(
const
Item
&
);
/* Prevent use of these */
void
operator
=
(
Field
&
);
public:
static
void
*
operator
new
(
size_t
size
)
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
*
operator
new
(
size_t
size
)
throw
()
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr_arg
,
size_t
size
)
{
TRASH
(
ptr_arg
,
size
);
}
char
*
ptr
;
// Position to field in record
...
...
sql/item.h
View file @
839b60a8
...
...
@@ -439,9 +439,9 @@ class Item {
Item
(
const
Item
&
);
/* Prevent use of these */
void
operator
=
(
Item
&
);
public:
static
void
*
operator
new
(
size_t
size
)
static
void
*
operator
new
(
size_t
size
)
throw
()
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
throw
()
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr
,
size_t
size
)
{
TRASH
(
ptr
,
size
);
}
static
void
operator
delete
(
void
*
ptr
,
MEM_ROOT
*
mem_root
)
{}
...
...
sql/sp_head.cc
View file @
839b60a8
...
...
@@ -446,7 +446,7 @@ sp_head::operator new(size_t size) throw()
init_sql_alloc
(
&
own_root
,
MEM_ROOT_BLOCK_SIZE
,
MEM_ROOT_PREALLOC
);
sp
=
(
sp_head
*
)
alloc_root
(
&
own_root
,
size
);
if
(
sp
==
NULL
)
return
NULL
;
DBUG_RETURN
(
NULL
)
;
sp
->
main_mem_root
=
own_root
;
DBUG_PRINT
(
"info"
,
(
"mem_root 0x%lx"
,
(
ulong
)
&
sp
->
mem_root
));
DBUG_RETURN
(
sp
);
...
...
sql/sql_lex.h
View file @
839b60a8
...
...
@@ -331,11 +331,11 @@ class st_select_lex_node {
bool
no_table_names_allowed
;
/* used for global order by */
bool
no_error
;
/* suppress error message (convert it to warnings) */
static
void
*
operator
new
(
size_t
size
)
static
void
*
operator
new
(
size_t
size
)
throw
()
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
throw
()
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr
,
size_t
size
)
{
TRASH
(
ptr
,
size
);
}
static
void
operator
delete
(
void
*
ptr
,
MEM_ROOT
*
mem_root
)
{}
...
...
sql/sql_list.h
View file @
839b60a8
...
...
@@ -27,7 +27,7 @@ class Sql_alloc
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
*
operator
new
[](
size_t
size
)
static
void
*
operator
new
[](
size_t
size
)
throw
()
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
...
...
@@ -466,7 +466,7 @@ template <class T> class List_iterator_fast :public base_list_iterator
struct
ilink
{
struct
ilink
**
prev
,
*
next
;
static
void
*
operator
new
(
size_t
size
)
static
void
*
operator
new
(
size_t
size
)
throw
()
{
return
(
void
*
)
my_malloc
((
uint
)
size
,
MYF
(
MY_WME
|
MY_FAE
));
}
...
...
sql/sql_string.h
View file @
839b60a8
...
...
@@ -78,7 +78,7 @@ class String
Alloced_length
=
str
.
Alloced_length
;
alloced
=
0
;
str_charset
=
str
.
str_charset
;
}
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
static
void
*
operator
new
(
size_t
size
,
MEM_ROOT
*
mem_root
)
throw
()
{
return
(
void
*
)
alloc_root
(
mem_root
,
(
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr_arg
,
size_t
size
)
{
TRASH
(
ptr_arg
,
size
);
}
...
...
sql/sql_yacc.yy
View file @
839b60a8
This diff is collapsed.
Click to expand it.
sql/thr_malloc.cc
View file @
839b60a8
...
...
@@ -21,10 +21,35 @@
extern
"C"
{
void
sql_alloc_error_handler
(
void
)
{
THD
*
thd
=
current_thd
;
if
(
thd
)
// QQ; To be removed
thd
->
fatal_error
();
/* purecov: inspected */
sql_print_error
(
ER
(
ER_OUT_OF_RESOURCES
));
THD
*
thd
=
current_thd
;
if
(
thd
)
{
/*
This thread is Out Of Memory.
An OOM condition is a fatal error.
It should not be caught by error handlers in stored procedures.
Also, recording that SQL condition in the condition area could
cause more memory allocations, which in turn could raise more
OOM conditions, causing recursion in the error handling code itself.
As a result, my_error() should not be invoked, and the
thread diagnostics area is set to an error status directly.
The visible result for a client application will be:
- a query fails with an ER_OUT_OF_RESOURCES error,
returned in the error packet.
- SHOW ERROR/SHOW WARNINGS may be empty.
*/
NET
*
net
=
&
thd
->
net
;
thd
->
fatal_error
();
if
(
!
net
->
last_error
[
0
])
// Return only first message
{
strmake
(
net
->
last_error
,
ER
(
ER_OUT_OF_RESOURCES
),
sizeof
(
net
->
last_error
)
-
1
);
net
->
last_errno
=
ER_OUT_OF_RESOURCES
;
}
}
}
}
...
...
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