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
4a0ec786
Commit
4a0ec786
authored
Oct 16, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doxygenized comments.
parent
12796f02
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2158 additions
and
2163 deletions
+2158
-2163
sql/sql_base.cc
sql/sql_base.cc
+15
-15
sql/sql_cache.cc
sql/sql_cache.cc
+11
-11
sql/sql_class.cc
sql/sql_class.cc
+1
-1
sql/sql_cursor.cc
sql/sql_cursor.cc
+41
-37
sql/sql_parse.cc
sql/sql_parse.cc
+383
-429
sql/sql_prepare.cc
sql/sql_prepare.cc
+288
-312
sql/sql_select.cc
sql/sql_select.cc
+1236
-1176
sql/sql_trigger.cc
sql/sql_trigger.cc
+181
-180
sql/sql_update.cc
sql/sql_update.cc
+1
-1
sql/sql_view.cc
sql/sql_view.cc
+1
-1
No files found.
sql/sql_base.cc
View file @
4a0ec786
...
@@ -1817,8 +1817,8 @@ static void relink_unused(TABLE *table)
...
@@ -1817,8 +1817,8 @@ static void relink_unused(TABLE *table)
/**
/**
@brief
Remove all instances of table from thread's open list and
Remove all instances of table from thread's open list and
table cache.
table cache.
@param thd Thread context
@param thd Thread context
@param find Table to remove
@param find Table to remove
...
@@ -1867,7 +1867,7 @@ void unlink_open_table(THD *thd, TABLE *find, bool unlock)
...
@@ -1867,7 +1867,7 @@ void unlink_open_table(THD *thd, TABLE *find, bool unlock)
/**
/**
@brief
Auxiliary routine which closes and drops open table.
Auxiliary routine which closes and drops open table.
@param thd Thread handle
@param thd Thread handle
@param table TABLE object for table to be dropped
@param table TABLE object for table to be dropped
...
@@ -2039,9 +2039,9 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in)
...
@@ -2039,9 +2039,9 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in)
/**
/**
@brief
Create and insert into table cache placeholder for table
Create and insert into table cache placeholder for table
which will prevent its opening (or creation) (a.k.a lock
which will prevent its opening (or creation) (a.k.a lock
table name).
table name).
@param thd Thread context
@param thd Thread context
@param key Table cache key for name to be locked
@param key Table cache key for name to be locked
...
@@ -2090,8 +2090,8 @@ TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
...
@@ -2090,8 +2090,8 @@ TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
/**
/**
@brief
Obtain an exclusive name lock on the table if it is not cached
Obtain an exclusive name lock on the table if it is not cached
in the table cache.
in the table cache.
@param thd Thread context
@param thd Thread context
@param db Name of database
@param db Name of database
...
@@ -2142,8 +2142,8 @@ bool lock_table_name_if_not_cached(THD *thd, const char *db,
...
@@ -2142,8 +2142,8 @@ bool lock_table_name_if_not_cached(THD *thd, const char *db,
/**
/**
@brief
Check that table exists in table definition cache, on disk
Check that table exists in table definition cache, on disk
or in some storage engine.
or in some storage engine.
@param thd Thread context
@param thd Thread context
@param table Table list element
@param table Table list element
...
@@ -2815,8 +2815,8 @@ bool reopen_table(TABLE *table)
...
@@ -2815,8 +2815,8 @@ bool reopen_table(TABLE *table)
/**
/**
@brief
Close all instances of a table open by this thread and replace
Close all instances of a table open by this thread and replace
them with exclusive name-locks.
them with exclusive name-locks.
@param thd Thread context
@param thd Thread context
@param db Database name for the table to be closed
@param db Database name for the table to be closed
...
@@ -2867,7 +2867,7 @@ void close_data_files_and_morph_locks(THD *thd, const char *db,
...
@@ -2867,7 +2867,7 @@ void close_data_files_and_morph_locks(THD *thd, const char *db,
/**
/**
@brief
Reopen all tables with closed data files.
Reopen all tables with closed data files.
@param thd Thread context
@param thd Thread context
@param get_locks Should we get locks after reopening tables ?
@param get_locks Should we get locks after reopening tables ?
...
@@ -2957,8 +2957,8 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
...
@@ -2957,8 +2957,8 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
/**
/**
@brief
Close handlers for tables in list, but leave the TABLE structure
Close handlers for tables in list, but leave the TABLE structure
intact so that we can re-open these quickly.
intact so that we can re-open these quickly.
@param thd Thread context
@param thd Thread context
@param table Head of the list of TABLE objects
@param table Head of the list of TABLE objects
...
...
sql/sql_cache.cc
View file @
4a0ec786
...
@@ -1524,7 +1524,7 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
...
@@ -1524,7 +1524,7 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
/**
/**
@brief
Synchronize the thread with any flushing operations.
Synchronize the thread with any flushing operations.
This helper function is called whenever a thread needs to operate on the
This helper function is called whenever a thread needs to operate on the
query cache structure (example: during invalidation). If a table flush is in
query cache structure (example: during invalidation). If a table flush is in
...
@@ -1565,7 +1565,7 @@ void Query_cache::wait_while_table_flush_is_in_progress(bool *interrupt)
...
@@ -1565,7 +1565,7 @@ void Query_cache::wait_while_table_flush_is_in_progress(bool *interrupt)
/**
/**
@brief Remove all cached queries that uses the given database
Remove all cached queries that uses the given database.
*/
*/
void
Query_cache
::
invalidate
(
char
*
db
)
void
Query_cache
::
invalidate
(
char
*
db
)
...
@@ -1675,8 +1675,8 @@ void Query_cache::flush()
...
@@ -1675,8 +1675,8 @@ void Query_cache::flush()
/**
/**
@brief
Rearrange the memory blocks and join result in cache in 1 block (if
Rearrange the memory blocks and join result in cache in 1 block (if
result length > join_limit)
result length > join_limit)
@param[in] join_limit If the minimum length of a result block to be joined.
@param[in] join_limit If the minimum length of a result block to be joined.
@param[in] iteration_limit The maximum number of packing and joining
@param[in] iteration_limit The maximum number of packing and joining
...
@@ -1946,7 +1946,7 @@ void Query_cache::make_disabled()
...
@@ -1946,7 +1946,7 @@ void Query_cache::make_disabled()
/**
/**
@class Query_cache
@class Query_cache
@brief
Free all resources allocated by the cache.
Free all resources allocated by the cache.
This function frees all resources allocated by the cache. You
This function frees all resources allocated by the cache. You
have to call init_cache() before using the cache again. This function
have to call init_cache() before using the cache again. This function
...
@@ -1970,7 +1970,7 @@ void Query_cache::free_cache()
...
@@ -1970,7 +1970,7 @@ void Query_cache::free_cache()
/**
/**
@brief
Flush the cache.
Flush the cache.
This function will flush cache contents. It assumes we have
This function will flush cache contents. It assumes we have
'structure_guard_mutex' locked. The function sets the m_cache_status flag and
'structure_guard_mutex' locked. The function sets the m_cache_status flag and
...
@@ -2516,7 +2516,7 @@ Query_cache::invalidate_table_internal(THD *thd, uchar *key, uint32 key_length)
...
@@ -2516,7 +2516,7 @@ Query_cache::invalidate_table_internal(THD *thd, uchar *key, uint32 key_length)
}
}
/**
/**
@brief
Invalidate a linked list of query cache blocks.
Invalidate a linked list of query cache blocks.
Each block tries to aquire a block level lock before
Each block tries to aquire a block level lock before
free_query is a called. This function will in turn affect
free_query is a called. This function will in turn affect
...
@@ -2684,7 +2684,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
...
@@ -2684,7 +2684,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
/**
/**
@brief
Insert used table name into the cache.
Insert used table name into the cache.
@return Error status
@return Error status
@retval FALSE On error
@retval FALSE On error
...
@@ -3413,8 +3413,8 @@ my_bool Query_cache::ask_handler_allowance(THD *thd,
...
@@ -3413,8 +3413,8 @@ my_bool Query_cache::ask_handler_allowance(THD *thd,
/**
/**
@brief
Rearrange all memory blocks so that free memory joins at the
Rearrange all memory blocks so that free memory joins at the
'bottom' of the allocated memory block containing all cache data.
'bottom' of the allocated memory block containing all cache data.
@see Query_cache::pack(ulong join_limit, uint iteration_limit)
@see Query_cache::pack(ulong join_limit, uint iteration_limit)
*/
*/
...
@@ -4028,7 +4028,7 @@ void Query_cache::tables_dump()
...
@@ -4028,7 +4028,7 @@ void Query_cache::tables_dump()
/**
/**
@brief
Checks integrity of the various linked lists
Checks integrity of the various linked lists
@return Error status code
@return Error status code
@retval FALSE Query cache is operational.
@retval FALSE Query cache is operational.
...
...
sql/sql_class.cc
View file @
4a0ec786
...
@@ -934,7 +934,7 @@ void THD::cleanup_after_query()
...
@@ -934,7 +934,7 @@ void THD::cleanup_after_query()
/**
/**
Create a LEX_STRING in this connection
Create a LEX_STRING in this connection
.
@param lex_str pointer to LEX_STRING object to be initialized
@param lex_str pointer to LEX_STRING object to be initialized
@param str initializer to be copied into lex_str
@param str initializer to be copied into lex_str
...
...
sql/sql_cursor.cc
View file @
4a0ec786
...
@@ -24,9 +24,9 @@
...
@@ -24,9 +24,9 @@
Declarations.
Declarations.
****************************************************************************/
****************************************************************************/
/*
/*
*
Sensitive_cursor -- a sensitive non-materialized server side
Sensitive_cursor -- a sensitive non-materialized server side
cursor An instance of this class cursor has its own runtime
cursor
.
An instance of this class cursor has its own runtime
state -- list of used items and memory root for runtime memory,
state -- list of used items and memory root for runtime memory,
open and locked tables, change list for the changes of the
open and locked tables, change list for the changes of the
parsed tree. This state is freed when the cursor is closed.
parsed tree. This state is freed when the cursor is closed.
...
@@ -69,7 +69,7 @@ class Sensitive_cursor: public Server_side_cursor
...
@@ -69,7 +69,7 @@ class Sensitive_cursor: public Server_side_cursor
};
};
/*
/*
*
Materialized_cursor -- an insensitive materialized server-side
Materialized_cursor -- an insensitive materialized server-side
cursor. The result set of this cursor is saved in a temporary
cursor. The result set of this cursor is saved in a temporary
table at open. The cursor itself is simply an interface for the
table at open. The cursor itself is simply an interface for the
...
@@ -96,7 +96,7 @@ class Materialized_cursor: public Server_side_cursor
...
@@ -96,7 +96,7 @@ class Materialized_cursor: public Server_side_cursor
};
};
/*
/*
*
Select_materialize -- a mediator between a cursor query and the
Select_materialize -- a mediator between a cursor query and the
protocol. In case we were not able to open a non-materialzed
protocol. In case we were not able to open a non-materialzed
cursor, it creates an internal temporary HEAP table, and insert
cursor, it creates an internal temporary HEAP table, and insert
...
@@ -107,7 +107,7 @@ class Materialized_cursor: public Server_side_cursor
...
@@ -107,7 +107,7 @@ class Materialized_cursor: public Server_side_cursor
class
Select_materialize
:
public
select_union
class
Select_materialize
:
public
select_union
{
{
select_result
*
result
;
/* the result object of the caller (PS or SP) */
select_result
*
result
;
/*
*<
the result object of the caller (PS or SP) */
public:
public:
Select_materialize
(
select_result
*
result_arg
)
:
result
(
result_arg
)
{}
Select_materialize
(
select_result
*
result_arg
)
:
result
(
result_arg
)
{}
virtual
bool
send_fields
(
List
<
Item
>
&
list
,
uint
flags
);
virtual
bool
send_fields
(
List
<
Item
>
&
list
,
uint
flags
);
...
@@ -116,22 +116,21 @@ class Select_materialize: public select_union
...
@@ -116,22 +116,21 @@ class Select_materialize: public select_union
/**************************************************************************/
/**************************************************************************/
/*
/*
*
Attempt to open a materialized or non-materialized cursor.
Attempt to open a materialized or non-materialized cursor.
SYNOPSIS
@param thd thread handle
mysql_open_cursor()
@param[in] flags create a materialized cursor or not
thd thread handle
@param[in] result result class of the caller used as a destination
flags [in] create a materialized cursor or not
for the rows fetched from the cursor
result [in] result class of the caller used as a destination
@param[out] pcursor a pointer to store a pointer to cursor in
for the rows fetched from the cursor
pcursor [out] a pointer to store a pointer to cursor in
@retval
0 the query has been successfully executed; in this
RETURN VALUE
case pcursor may or may not contain
0 the query has been successfully executed; in this
a pointer to an open cursor.
case pcursor may or may not contain
@retval
a pointer to an open cursor.
non-zero an error, 'pcursor' has been left intact.
non-zero an error, 'pcursor' has been left intact.
*/
*/
int
mysql_open_cursor
(
THD
*
thd
,
uint
flags
,
select_result
*
result
,
int
mysql_open_cursor
(
THD
*
thd
,
uint
flags
,
select_result
*
result
,
...
@@ -279,6 +278,14 @@ Sensitive_cursor::Sensitive_cursor(THD *thd, select_result *result_arg)
...
@@ -279,6 +278,14 @@ Sensitive_cursor::Sensitive_cursor(THD *thd, select_result *result_arg)
}
}
/**
Save THD state into cursor.
@todo
- XXX: thd->locked_tables is not changed.
- What problems can we have with it if cursor is open?
- TODO: must be fixed because of the prelocked mode.
*/
void
void
Sensitive_cursor
::
post_open
(
THD
*
thd
)
Sensitive_cursor
::
post_open
(
THD
*
thd
)
{
{
...
@@ -334,6 +341,10 @@ Sensitive_cursor::post_open(THD *thd)
...
@@ -334,6 +341,10 @@ Sensitive_cursor::post_open(THD *thd)
}
}
/**
bzero cursor state in THD.
*/
void
void
Sensitive_cursor
::
reset_thd
(
THD
*
thd
)
Sensitive_cursor
::
reset_thd
(
THD
*
thd
)
{
{
...
@@ -393,20 +404,13 @@ Sensitive_cursor::open(JOIN *join_arg)
...
@@ -393,20 +404,13 @@ Sensitive_cursor::open(JOIN *join_arg)
}
}
/*
/**
SYNOPSIS
Fetch next num_rows rows from the cursor and send them to the client.
Sensitive_cursor::fetch()
num_rows fetch up to this number of rows (maybe less)
DESCRIPTION
Fetch next num_rows rows from the cursor and send them to the client
Precondition:
Precondition:
Sensitive_cursor is open
-
Sensitive_cursor is open
RETURN VALUES:
@param num_rows fetch up to this number of rows (maybe less)
none, this function will send OK to the clinet or set an error
message in THD
*/
*/
void
void
...
@@ -478,6 +482,11 @@ Sensitive_cursor::fetch(ulong num_rows)
...
@@ -478,6 +482,11 @@ Sensitive_cursor::fetch(ulong num_rows)
}
}
/**
@todo
Another hack: we need to set THD state as if in a fetch to be
able to call stmt close.
*/
void
void
Sensitive_cursor
::
close
()
Sensitive_cursor
::
close
()
{
{
...
@@ -579,10 +588,9 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
...
@@ -579,10 +588,9 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
}
}
/*
/*
*
Fetch up to the given number of rows from a materialized cursor.
Fetch up to the given number of rows from a materialized cursor.
DESCRIPTION
Precondition: the cursor is open.
Precondition: the cursor is open.
If the cursor points after the last row, the fetch will automatically
If the cursor points after the last row, the fetch will automatically
...
@@ -590,10 +598,6 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
...
@@ -590,10 +598,6 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
with SERVER_STATUS_LAST_ROW_SENT). This is an extra round trip
with SERVER_STATUS_LAST_ROW_SENT). This is an extra round trip
and probably should be improved to return
and probably should be improved to return
SERVER_STATUS_LAST_ROW_SENT along with the last row.
SERVER_STATUS_LAST_ROW_SENT along with the last row.
RETURN VALUE
none, in case of success the row is sent to the client, otherwise
an error message is set in THD
*/
*/
void
Materialized_cursor
::
fetch
(
ulong
num_rows
)
void
Materialized_cursor
::
fetch
(
ulong
num_rows
)
...
...
sql/sql_parse.cc
View file @
4a0ec786
This diff is collapsed.
Click to expand it.
sql/sql_prepare.cc
View file @
4a0ec786
This diff is collapsed.
Click to expand it.
sql/sql_select.cc
View file @
4a0ec786
This diff is collapsed.
Click to expand it.
sql/sql_trigger.cc
View file @
4a0ec786
This diff is collapsed.
Click to expand it.
sql/sql_update.cc
View file @
4a0ec786
...
@@ -84,7 +84,7 @@ static bool check_fields(THD *thd, List<Item> &items)
...
@@ -84,7 +84,7 @@ static bool check_fields(THD *thd, List<Item> &items)
/**
/**
@brief
Re-read record if more columns are needed for error message.
Re-read record if more columns are needed for error message.
If we got a duplicate key error, we want to write an error
If we got a duplicate key error, we want to write an error
message containing the value of the duplicate key. If we do not have
message containing the value of the duplicate key. If we do not have
...
...
sql/sql_view.cc
View file @
4a0ec786
...
@@ -206,7 +206,7 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
...
@@ -206,7 +206,7 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
/**
/**
@brief
Creating/altering VIEW procedure
Creating/altering VIEW procedure
@param thd thread handler
@param thd thread handler
@param views views to create
@param views views to create
...
...
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