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
d7dd19aa
Commit
d7dd19aa
authored
Aug 24, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-root-root
parents
2ba96c63
d261072f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
16 deletions
+25
-16
include/config-win.h
include/config-win.h
+5
-0
sql/sql_class.cc
sql/sql_class.cc
+3
-3
sql/sql_class.h
sql/sql_class.h
+8
-4
sql/sql_prepare.cc
sql/sql_prepare.cc
+9
-9
No files found.
include/config-win.h
View file @
d7dd19aa
...
@@ -150,6 +150,11 @@ typedef uint rf_SetTimer;
...
@@ -150,6 +150,11 @@ typedef uint rf_SetTimer;
#define HAVE_NAMED_PIPE
/* We can only create pipes on NT */
#define HAVE_NAMED_PIPE
/* We can only create pipes on NT */
#endif
#endif
/* ERROR is defined in wingdi.h */
#ifdef ERROR
#undef ERROR
#endif
/* We need to close files to break connections on shutdown */
/* We need to close files to break connections on shutdown */
#ifndef SIGNAL_WITH_VIO_CLOSE
#ifndef SIGNAL_WITH_VIO_CLOSE
#define SIGNAL_WITH_VIO_CLOSE
#define SIGNAL_WITH_VIO_CLOSE
...
...
sql/sql_class.cc
View file @
d7dd19aa
...
@@ -1303,7 +1303,7 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
...
@@ -1303,7 +1303,7 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
Item_arena
::
Item_arena
(
THD
*
thd
)
Item_arena
::
Item_arena
(
THD
*
thd
)
:
free_list
(
0
),
:
free_list
(
0
),
state
(
INITIALIZED
)
state
(
(
int
)
INITIALIZED
)
{
{
init_sql_alloc
(
&
mem_root
,
init_sql_alloc
(
&
mem_root
,
thd
->
variables
.
query_alloc_block_size
,
thd
->
variables
.
query_alloc_block_size
,
...
@@ -1315,7 +1315,7 @@ Item_arena::Item_arena(THD* thd)
...
@@ -1315,7 +1315,7 @@ Item_arena::Item_arena(THD* thd)
Item_arena
::
Item_arena
()
Item_arena
::
Item_arena
()
:
free_list
(
0
),
:
free_list
(
0
),
state
(
CONVENTIONAL_EXECUTION
)
state
(
(
int
)
CONVENTIONAL_EXECUTION
)
{
{
clear_alloc_root
(
&
mem_root
);
clear_alloc_root
(
&
mem_root
);
}
}
...
@@ -1323,7 +1323,7 @@ Item_arena::Item_arena()
...
@@ -1323,7 +1323,7 @@ Item_arena::Item_arena()
Item_arena
::
Item_arena
(
bool
init_mem_root
)
Item_arena
::
Item_arena
(
bool
init_mem_root
)
:
free_list
(
0
),
:
free_list
(
0
),
state
(
INITIALIZED
)
state
(
(
int
)
INITIALIZED
)
{
{
if
(
init_mem_root
)
if
(
init_mem_root
)
clear_alloc_root
(
&
mem_root
);
clear_alloc_root
(
&
mem_root
);
...
...
sql/sql_class.h
View file @
d7dd19aa
...
@@ -427,8 +427,12 @@ public:
...
@@ -427,8 +427,12 @@ public:
*/
*/
Item
*
free_list
;
Item
*
free_list
;
MEM_ROOT
mem_root
;
MEM_ROOT
mem_root
;
static
const
int
INITIALIZED
=
0
,
PREPARED
=
1
,
EXECUTED
=
3
,
enum
CONVENTIONAL_EXECUTION
=
2
,
ERROR
=
-
1
;
{
INITIALIZED
=
0
,
PREPARED
=
1
,
EXECUTED
=
3
,
CONVENTIONAL_EXECUTION
=
2
,
ERROR
=
-
1
};
int
state
;
int
state
;
/* We build without RTTI, so dynamic_cast can't be used. */
/* We build without RTTI, so dynamic_cast can't be used. */
...
@@ -443,8 +447,8 @@ public:
...
@@ -443,8 +447,8 @@ public:
virtual
Type
type
()
const
;
virtual
Type
type
()
const
;
virtual
~
Item_arena
();
virtual
~
Item_arena
();
inline
bool
is_stmt_prepare
()
const
{
return
state
<
PREPARED
;
}
inline
bool
is_stmt_prepare
()
const
{
return
state
<
(
int
)
PREPARED
;
}
inline
bool
is_first_stmt_execute
()
const
{
return
state
==
PREPARED
;
}
inline
bool
is_first_stmt_execute
()
const
{
return
state
==
(
int
)
PREPARED
;
}
inline
gptr
alloc
(
unsigned
int
size
)
{
return
alloc_root
(
&
mem_root
,
size
);
}
inline
gptr
alloc
(
unsigned
int
size
)
{
return
alloc_root
(
&
mem_root
,
size
);
}
inline
gptr
calloc
(
unsigned
int
size
)
inline
gptr
calloc
(
unsigned
int
size
)
{
{
...
...
sql/sql_prepare.cc
View file @
d7dd19aa
...
@@ -132,7 +132,7 @@ find_prepared_statement(THD *thd, ulong id, const char *where,
...
@@ -132,7 +132,7 @@ find_prepared_statement(THD *thd, ulong id, const char *where,
{
{
Statement
*
stmt
=
thd
->
stmt_map
.
find
(
id
);
Statement
*
stmt
=
thd
->
stmt_map
.
find
(
id
);
if
(
stmt
==
0
||
stmt
->
type
()
!=
Item_arena
::
PREPARED_STATEMENT
)
if
(
stmt
==
0
||
stmt
->
type
()
!=
(
int
)
Item_arena
::
PREPARED_STATEMENT
)
{
{
char
llbuf
[
22
];
char
llbuf
[
22
];
my_error
(
ER_UNKNOWN_STMT_HANDLER
,
MYF
(
0
),
22
,
llstr
(
id
,
llbuf
),
where
);
my_error
(
ER_UNKNOWN_STMT_HANDLER
,
MYF
(
0
),
22
,
llstr
(
id
,
llbuf
),
where
);
...
@@ -1619,7 +1619,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
...
@@ -1619,7 +1619,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
{
{
sl
->
prep_where
=
sl
->
where
;
sl
->
prep_where
=
sl
->
where
;
}
}
stmt
->
state
=
Prepared_statement
::
PREPARED
;
stmt
->
state
=
(
int
)
Prepared_statement
::
PREPARED
;
}
}
DBUG_RETURN
(
!
stmt
);
DBUG_RETURN
(
!
stmt
);
...
@@ -1733,7 +1733,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
...
@@ -1733,7 +1733,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
DBUG_PRINT
(
"exec_query:"
,
(
"%s"
,
stmt
->
query
));
DBUG_PRINT
(
"exec_query:"
,
(
"%s"
,
stmt
->
query
));
/* Check if we got an error when sending long data */
/* Check if we got an error when sending long data */
if
(
stmt
->
state
==
Item_arena
::
ERROR
)
if
(
stmt
->
state
==
(
int
)
Item_arena
::
ERROR
)
{
{
send_error
(
thd
,
stmt
->
last_errno
,
stmt
->
last_error
);
send_error
(
thd
,
stmt
->
last_errno
,
stmt
->
last_error
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1850,7 +1850,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
...
@@ -1850,7 +1850,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
transformations of the query tree (i.e. negations elimination).
transformations of the query tree (i.e. negations elimination).
This should be done permanently on the parse tree of this statement.
This should be done permanently on the parse tree of this statement.
*/
*/
if
(
stmt
->
state
==
Item_arena
::
PREPARED
)
if
(
stmt
->
state
==
(
int
)
Item_arena
::
PREPARED
)
thd
->
current_arena
=
stmt
;
thd
->
current_arena
=
stmt
;
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
...
@@ -1863,10 +1863,10 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
...
@@ -1863,10 +1863,10 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
/* Free Items that were created during this execution of the PS. */
/* Free Items that were created during this execution of the PS. */
free_items
(
thd
->
free_list
);
free_items
(
thd
->
free_list
);
thd
->
free_list
=
0
;
thd
->
free_list
=
0
;
if
(
stmt
->
state
==
Item_arena
::
PREPARED
)
if
(
stmt
->
state
==
(
int
)
Item_arena
::
PREPARED
)
{
{
thd
->
current_arena
=
thd
;
thd
->
current_arena
=
thd
;
stmt
->
state
=
Item_arena
::
EXECUTED
;
stmt
->
state
=
(
int
)
Item_arena
::
EXECUTED
;
}
}
cleanup_items
(
stmt
->
free_list
);
cleanup_items
(
stmt
->
free_list
);
reset_stmt_params
(
stmt
);
reset_stmt_params
(
stmt
);
...
@@ -1905,7 +1905,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
...
@@ -1905,7 +1905,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
SEND_ERROR
)))
SEND_ERROR
)))
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
stmt
->
state
=
Item_arena
::
PREPARED
;
stmt
->
state
=
(
int
)
Item_arena
::
PREPARED
;
/*
/*
Clear parameters from data which could be set by
Clear parameters from data which could be set by
...
@@ -1993,7 +1993,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
...
@@ -1993,7 +1993,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
if
(
param_number
>=
stmt
->
param_count
)
if
(
param_number
>=
stmt
->
param_count
)
{
{
/* Error will be sent in execute call */
/* Error will be sent in execute call */
stmt
->
state
=
Item_arena
::
ERROR
;
stmt
->
state
=
(
int
)
Item_arena
::
ERROR
;
stmt
->
last_errno
=
ER_WRONG_ARGUMENTS
;
stmt
->
last_errno
=
ER_WRONG_ARGUMENTS
;
sprintf
(
stmt
->
last_error
,
ER
(
ER_WRONG_ARGUMENTS
),
sprintf
(
stmt
->
last_error
,
ER
(
ER_WRONG_ARGUMENTS
),
"mysql_stmt_send_long_data"
);
"mysql_stmt_send_long_data"
);
...
@@ -2009,7 +2009,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
...
@@ -2009,7 +2009,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
if
(
param
->
set_longdata
(
thd
->
extra_data
,
thd
->
extra_length
))
if
(
param
->
set_longdata
(
thd
->
extra_data
,
thd
->
extra_length
))
#endif
#endif
{
{
stmt
->
state
=
Item_arena
::
ERROR
;
stmt
->
state
=
(
int
)
Item_arena
::
ERROR
;
stmt
->
last_errno
=
ER_OUTOFMEMORY
;
stmt
->
last_errno
=
ER_OUTOFMEMORY
;
sprintf
(
stmt
->
last_error
,
ER
(
ER_OUTOFMEMORY
),
0
);
sprintf
(
stmt
->
last_error
,
ER
(
ER_OUTOFMEMORY
),
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