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
5cacc972
Commit
5cacc972
authored
Mar 02, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents
a05c54b6
8cc8b0ea
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
436 additions
and
394 deletions
+436
-394
include/my_sys.h
include/my_sys.h
+1
-0
sql/item.h
sql/item.h
+2
-2
sql/mysql_priv.h
sql/mysql_priv.h
+1
-2
sql/protocol.h
sql/protocol.h
+0
-5
sql/sql_class.cc
sql/sql_class.cc
+2
-11
sql/sql_class.h
sql/sql_class.h
+14
-14
sql/sql_lex.h
sql/sql_lex.h
+1
-2
sql/sql_parse.cc
sql/sql_parse.cc
+24
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+381
-352
sql/sql_yacc.yy
sql/sql_yacc.yy
+10
-4
tests/client_test.c
tests/client_test.c
+0
-2
No files found.
include/my_sys.h
View file @
5cacc972
...
...
@@ -714,6 +714,7 @@ extern void my_free_lock(byte *ptr,myf flags);
#define my_free_lock(A,B) my_free((A),(B))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
#define clear_alloc_root(A) bzero((void *) (A), sizeof(MEM_ROOT))
extern
void
init_alloc_root
(
MEM_ROOT
*
mem_root
,
uint
block_size
,
uint
pre_alloc_size
);
extern
gptr
alloc_root
(
MEM_ROOT
*
mem_root
,
unsigned
int
Size
);
...
...
sql/item.h
View file @
5cacc972
...
...
@@ -375,9 +375,9 @@ public:
bool
get_time
(
TIME
*
tm
);
void
reset
()
{}
#ifndef EMBEDDED_LIBRARY
void
(
*
set
up
_param_func
)(
Item_param
*
param
,
uchar
**
pos
);
void
(
*
set_param_func
)(
Item_param
*
param
,
uchar
**
pos
);
#else
void
(
*
set
up
_param_func
)(
Item_param
*
param
,
uchar
**
pos
,
ulong
data_len
);
void
(
*
set_param_func
)(
Item_param
*
param
,
uchar
**
pos
,
ulong
data_len
);
#endif
enum
Item_result
result_type
()
const
{
return
item_result_type
;
}
...
...
sql/mysql_priv.h
View file @
5cacc972
...
...
@@ -620,14 +620,13 @@ int mysqld_show_column_types(THD *thd);
int
mysqld_help
(
THD
*
thd
,
const
char
*
text
);
/* sql_prepare.cc */
bool
mysql_stmt_prepare
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
void
mysql_stmt_prepare
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
void
mysql_stmt_execute
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_free
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_reset
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_get_longdata
(
THD
*
thd
,
char
*
pos
,
ulong
packet_length
);
int
check_insert_fields
(
THD
*
thd
,
TABLE
*
table
,
List
<
Item
>
&
fields
,
List
<
Item
>
&
values
,
ulong
counter
);
void
setup_param_functions
(
Item_param
*
param
,
uchar
param_type
);
/* sql_error.cc */
MYSQL_ERROR
*
push_warning
(
THD
*
thd
,
MYSQL_ERROR
::
enum_warning_level
level
,
uint
code
,
...
...
sql/protocol.h
View file @
5cacc972
...
...
@@ -178,8 +178,3 @@ char *net_store_data(char *to,const char *from, uint length);
char
*
net_store_data
(
char
*
to
,
int32
from
);
char
*
net_store_data
(
char
*
to
,
longlong
from
);
#ifdef EMBEDDED_LIBRARY
bool
setup_params_data
(
struct
st_prep_stmt
*
stmt
);
bool
setup_params_data_withlog
(
struct
st_prep_stmt
*
stmt
);
#endif
sql/sql_class.cc
View file @
5cacc972
...
...
@@ -145,8 +145,7 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0),
init
();
/* Initialize sub structures */
bzero
((
char
*
)
&
transaction
.
mem_root
,
sizeof
(
transaction
.
mem_root
));
bzero
((
char
*
)
&
warn_root
,
sizeof
(
warn_root
));
clear_alloc_root
(
&
transaction
.
mem_root
);
init_alloc_root
(
&
warn_root
,
WARN_ALLOC_BLOCK_SIZE
,
WARN_ALLOC_PREALLOC_SIZE
);
user_connect
=
(
USER_CONN
*
)
0
;
hash_init
(
&
user_vars
,
&
my_charset_bin
,
USER_VARS_HASH_SIZE
,
0
,
0
,
...
...
@@ -331,7 +330,7 @@ THD::~THD()
dbug_sentry
=
THD_SENTRY_GONE
;
#endif
/* Reset stmt_backup.mem_root to not double-free memory from thd.mem_root */
init_alloc_root
(
&
stmt_backup
.
mem_root
,
0
,
0
);
clear_alloc_root
(
&
stmt_backup
.
mem_root
);
DBUG_VOID_RETURN
;
}
...
...
@@ -1185,10 +1184,8 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
Statement
::
Statement
(
THD
*
thd
)
:
id
(
++
thd
->
statement_id_counter
),
query_id
(
thd
->
query_id
),
set_query_id
(
1
),
allow_sum_func
(
0
),
command
(
thd
->
command
),
lex
(
&
main_lex
),
query
(
0
),
query_length
(
0
),
...
...
@@ -1207,10 +1204,8 @@ Statement::Statement(THD *thd)
Statement
::
Statement
()
:
id
(
0
),
query_id
(
0
),
/* initialized later */
set_query_id
(
1
),
allow_sum_func
(
0
),
/* initialized later */
command
(
COM_SLEEP
),
/* initialized later */
lex
(
&
main_lex
),
query
(
0
),
/* these two are set */
query_length
(
0
),
/* in alloc_query() */
...
...
@@ -1229,15 +1224,11 @@ Statement::Type Statement::type() const
void
Statement
::
set_statement
(
Statement
*
stmt
)
{
id
=
stmt
->
id
;
query_id
=
stmt
->
query_id
;
set_query_id
=
stmt
->
set_query_id
;
allow_sum_func
=
stmt
->
allow_sum_func
;
command
=
stmt
->
command
;
lex
=
stmt
->
lex
;
query
=
stmt
->
query
;
query_length
=
stmt
->
query_length
;
free_list
=
stmt
->
free_list
;
mem_root
=
stmt
->
mem_root
;
}
...
...
sql/sql_class.h
View file @
5cacc972
...
...
@@ -434,15 +434,6 @@ public:
*/
ulong
id
;
/*
Id of current query. Statement can be reused to execute several queries
query_id is global in context of the whole MySQL server.
ID is automatically generated from mutex-protected counter.
It's used in handler code for various purposes: to check which columns
from table are necessary for this select, to check if it's necessary to
update auto-updatable fields (like auto_increment and timestamp).
*/
ulong
query_id
;
/*
- if set_query_id=1, we set field->query_id for all fields. In that case
field list can not contain duplicates.
...
...
@@ -461,11 +452,6 @@ public:
See item_sum.cc for details.
*/
bool
allow_sum_func
;
/*
Type of current query: COM_PREPARE, COM_QUERY, etc. Set from
first byte of the packet in do_command()
*/
enum
enum_server_command
command
;
LEX
*
lex
;
// parse tree descriptor
/*
...
...
@@ -676,6 +662,11 @@ public:
uint
dbug_sentry
;
// watch out for memory corruption
#endif
struct
st_my_thread_var
*
mysys_var
;
/*
Type of current query: COM_PREPARE, COM_QUERY, etc. Set from
first byte of the packet in do_command()
*/
enum
enum_server_command
command
;
uint32
server_id
;
uint32
file_id
;
// for LOAD DATA INFILE
/*
...
...
@@ -751,6 +742,15 @@ public:
List
<
MYSQL_ERROR
>
warn_list
;
uint
warn_count
[(
uint
)
MYSQL_ERROR
::
WARN_LEVEL_END
];
uint
total_warn_count
;
/*
Id of current query. Statement can be reused to execute several queries
query_id is global in context of the whole MySQL server.
ID is automatically generated from mutex-protected counter.
It's used in handler code for various purposes: to check which columns
from table are necessary for this select, to check if it's necessary to
update auto-updatable fields (like auto_increment and timestamp).
*/
ulong
query_id
;
ulong
warn_id
,
version
,
options
,
thread_id
,
col_access
;
/* Statement id is thread-wide. This counter is used to generate ids */
...
...
sql/sql_lex.h
View file @
5cacc972
...
...
@@ -552,7 +552,7 @@ typedef struct st_lex
List
<
Item
>
*
insert_list
,
field_list
,
value_list
;
List
<
List_item
>
many_values
;
List
<
set_var_base
>
var_list
;
List
<
Item
>
param_list
;
List
<
Item
_param
>
param_list
;
SQL_LIST
proc_list
,
auxilliary_table_list
,
save_list
;
TYPELIB
*
interval
;
create_field
*
last_field
;
...
...
@@ -577,7 +577,6 @@ typedef struct st_lex
uint
uint_geom_type
;
uint
grant
,
grant_tot_col
,
which_columns
;
uint
fk_delete_opt
,
fk_update_opt
,
fk_match_option
;
uint
param_count
;
uint
slave_thd_opt
;
uint8
describe
;
bool
drop_if_exists
,
drop_temporary
,
local_file
;
...
...
sql/sql_parse.cc
View file @
5cacc972
...
...
@@ -1232,10 +1232,34 @@ bool do_command(THD *thd)
command_name
[
command
]));
}
net
->
read_timeout
=
old_timeout
;
// restore it
/*
packet_length contains length of data, as it was stored in packet
header. In case of malformed header, packet_length can be zero.
If packet_length is not zero, my_net_read ensures that this number
of bytes was actually read from network. Additionally my_net_read
sets packet[packet_length]= 0 (thus if packet_length == 0,
command == packet[0] == COM_SLEEP).
In dispatch_command packet[packet_length] points beyond the end of packet.
*/
DBUG_RETURN
(
dispatch_command
(
command
,
thd
,
packet
+
1
,
(
uint
)
packet_length
));
}
#endif
/* EMBEDDED_LIBRARY */
/*
Perform one connection-level (COM_XXXX) command.
SYNOPSIS
dispatch_command()
thd connection handle
command type of command to perform
packet data for the command, packet is always null-terminated
packet_length length of packet + 1 (to show that data is
null-terminated) except for COM_SLEEP, where it
can be zero.
RETURN VALUE
0 ok
1 request of thread shutdown, i. e. if command is
COM_QUIT/COM_SHUTDOWN
*/
bool
dispatch_command
(
enum
enum_server_command
command
,
THD
*
thd
,
char
*
packet
,
uint
packet_length
)
...
...
sql/sql_prepare.cc
View file @
5cacc972
This diff is collapsed.
Click to expand it.
sql/sql_yacc.yy
View file @
5cacc972
...
...
@@ -4478,11 +4478,17 @@ text_string:
param_marker:
'?'
{
LEX *lex=Lex;
if (YYTHD->command == COM_PREPARE)
THD *thd=YYTHD;
LEX *lex= thd->lex;
if (thd->command == COM_PREPARE)
{
lex->param_list.push_back($$=new Item_param((uint)(lex->tok_start-(uchar *)YYTHD->query)));
lex->param_count++;
Item_param *item= new Item_param((uint) (lex->tok_start -
(uchar *) thd->query));
if (!($$= item) || lex->param_list.push_back(item))
{
send_error(thd, ER_OUT_OF_RESOURCES);
YYABORT;
}
}
else
{
...
...
tests/client_test.c
View file @
5cacc972
...
...
@@ -8470,8 +8470,6 @@ int main(int argc, char **argv)
start_time
=
time
((
time_t
*
)
0
);
test_subqueries
();
client_query
();
/* simple client query test */
#if NOT_YET_WORKING
/* Used for internal new development debugging */
...
...
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