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
b6a9ba5b
Commit
b6a9ba5b
authored
Dec 04, 2003
by
konstantin@oak.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
after-review fixes
parent
f2377c4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
26 deletions
+32
-26
sql/sql_class.cc
sql/sql_class.cc
+13
-17
sql/sql_class.h
sql/sql_class.h
+19
-9
No files found.
sql/sql_class.cc
View file @
b6a9ba5b
...
...
@@ -86,8 +86,7 @@ extern "C" void free_user_var(user_var_entry *entry)
** Thread specific functions
****************************************************************************/
THD
::
THD
()
:
user_time
(
0
),
is_fatal_error
(
0
),
THD
::
THD
()
:
user_time
(
0
),
is_fatal_error
(
0
),
last_insert_id_used
(
0
),
insert_id_used
(
0
),
rand_used
(
0
),
in_lock_tables
(
0
),
global_read_lock
(
0
),
bootstrap
(
0
),
spcont
(
NULL
)
...
...
@@ -108,6 +107,7 @@ THD::THD():user_time(0),
cuted_fields
=
sent_row_count
=
0L
;
statement_id_counter
=
0UL
;
// Must be reset to handle error with THD's created for init of mysqld
lex
->
current_select
=
0
;
start_time
=
(
time_t
)
0
;
current_linfo
=
0
;
slave_thread
=
0
;
...
...
@@ -339,12 +339,12 @@ THD::~THD()
safeFree
(
user
);
safeFree
(
db
);
safeFree
(
ip
);
free_root
(
&
warn_root
,
MYF
(
0
));
free_root
(
&
transaction
.
mem_root
,
MYF
(
0
));
mysys_var
=
0
;
// Safety (shouldn't be needed)
free_root
(
&
warn_root
,
MYF
(
0
));
free_root
(
&
transaction
.
mem_root
,
MYF
(
0
));
mysys_var
=
0
;
// Safety (shouldn't be needed)
pthread_mutex_destroy
(
&
LOCK_delete
);
#ifndef DBUG_OFF
dbug_sentry
=
THD_SENTRY_GONE
;
dbug_sentry
=
THD_SENTRY_GONE
;
#endif
DBUG_VOID_RETURN
;
}
...
...
@@ -1277,23 +1277,17 @@ Statement::Statement(THD *thd)
query_id
(
0
),
/* initialized later */
set_query_id
(
1
),
allow_sum_func
(
0
),
/* initialized later */
command
(
COM_SLEEP
),
/* reset in THD counstructor and mysql_parse */
command
(
COM_SLEEP
),
/* initialized later */
lex
(
&
main_lex
),
query
(
0
),
query_length
(
0
),
free_list
(
0
)
/* reset in THD constructor */
query
(
0
),
/* these two are set */
query_length
(
0
),
/* in alloc_query() */
free_list
(
0
)
{
init_sql_alloc
(
&
mem_root
,
thd
->
variables
.
query_alloc_block_size
,
thd
->
variables
.
query_prealloc_size
);
}
/*
This constructor is called when statement is a subobject of THD:
Some variables are initialized in THD::init due to locking problems
This statement object will be used to hold state of currently active
statement.
*/
Statement
::
Statement
()
:
id
(
0
),
...
...
@@ -1329,9 +1323,11 @@ get_statement_id_as_hash_key(const byte *record, uint *key_length,
C_MODE_END
Statement_map
::
Statement_map
()
{
enum
{
START_HASH_SIZE
=
16
};
hash_init
(
&
st_hash
,
default_charset_info
,
START_HASH_SIZE
,
0
,
0
,
get_statement_id_as_hash_key
,
(
hash_free_key
)
0
,
MYF
(
0
));
}
sql/sql_class.h
View file @
b6a9ba5b
...
...
@@ -454,22 +454,22 @@ class Statement
LEX
main_lex
;
public:
/*
Uniquely identifies each statement object in
scope of thread.
Can't be const at the moment because of substitute() method
Uniquely identifies each statement object in
thread scope; change during
statement lifetime.
*/
/* const */
ulong
id
;
ulong
id
;
/*
Id of current query. Statement can be reused to execute several queries
Id of current query. Statement can be reused to execute several queries
.
query_id is global in context of the whole MySQL server.
I
D
is automatically generated from mutex-protected counter.
I
d
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
- if set_query_id
==
1, we set field->query_id for all fields. In that case
field list can not contain duplicates.
*/
bool
set_query_id
;
...
...
@@ -487,8 +487,8 @@ class Statement
*/
bool
allow_sum_func
;
/*
Type of current query: COM_PREPARE, COM_QUERY, etc. Set from
first byte of the packet in do_command()
Type of current query: COM_PREPARE, COM_QUERY, etc. Set from
the
first byte of the
incoming
packet in do_command()
*/
enum
enum_server_command
command
;
...
...
@@ -508,6 +508,10 @@ class Statement
MEM_ROOT
mem_root
;
protected:
/*
This constructor is called when statement is a subobject of THD:
some variables are initialized in THD::init due to locking problems
*/
Statement
();
public:
Statement
(
THD
*
thd
);
...
...
@@ -529,7 +533,7 @@ class Statement_map
{
return
my_hash_insert
(
&
st_hash
,
(
byte
*
)
statement
);
}
Statement
*
seek
(
ulong
long
id
)
Statement
*
seek
(
ulong
id
)
{
return
(
Statement
*
)
hash_search
(
&
st_hash
,
(
byte
*
)
&
id
,
sizeof
(
id
));
}
...
...
@@ -685,6 +689,12 @@ class THD :public ilink,
USER_CONN
*
user_connect
;
CHARSET_INFO
*
db_charset
;
List
<
TABLE
>
temporary_tables_should_be_free
;
// list of temporary tables
/*
FIXME: this, and some other variables like 'count_cuted_fields'
maybe should be statement/cursor local, that is, moved to Statement
class. With current implementation warnings produced in each prepared
statement/ cursor settle here.
*/
List
<
MYSQL_ERROR
>
warn_list
;
uint
warn_count
[(
uint
)
MYSQL_ERROR
::
WARN_LEVEL_END
];
uint
total_warn_count
;
...
...
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