Commit graph

24 commits

Author SHA1 Message Date
vasil
12c03b4306 branches/zip:
Move the column trx_weight near the end in the
information_schema.innodb_trx table.

Suggested by:	Ken
Approved by:	Marko
2008-01-16 06:45:16 +00:00
marko
cdb5b46445 branches/zip: Implement wrappers for all operations on the buffer pool mutex.
buf_pool->mutex: Rename to buf_pool_mutex, so that the wrappers will have
to be used when changes are merged from other source trees.

buf_pool->zip_mutex: Rename to buf_pool_zip_mutex.

buf_pool_mutex_own(), buf_pool_mutex_enter(), buf_pool_mutex_exit():
Wrappers for buf_pool_mutex.
2008-01-10 09:37:13 +00:00
vasil
85b6ef6d33 branches/zip:
Change the format of TRX_IDs in INFORMATION_SCHEMA tables from DEC to
HEX.

The current TRX_IDs are hard to remember and track down: 426355, 428466,
428566, etc.

In HEX:
* there are less "digits", the strings are shorter;
* since there are 16 instead of 10 "digits", the chance of having
  repeating ones are smaller.

The above look like 68173, 689B2, 68A16 in HEX.

Discussed with:	Ken
Approved by:	Heikki (via IM)
2007-12-20 14:24:57 +00:00
vasil
97025c3acf branches/zip:
Non-functional change:
Do not include the terminating '\0' in TRX_I_S_LOCK_ID_MAX_LEN.
2007-12-18 09:44:03 +00:00
vasil
6a6d7a9b09 branches/zip:
* Change terminology:
  wait lock -> requested lock
  waited lock -> blocking lock
  new: requesting transaction (the trx what owns the requested lock)
  new: blocking transaction (the trx that owns the blocking lock)

* Add transaction ids to INFORMATION_SCHEMA.INNODB_LOCK_WAITS. This is
  somewhat redundant because transaction ids can be found in INNODB_LOCKS
  (which can be joined with INNODB_LOCK_WAITS) but would help users to
  write shorter joins (one table less) in some cases where they want to
  find which transaction is blocking which.

Suggested by:	Ken
Approved by:	Heikki
2007-11-29 13:47:09 +00:00
vasil
d4db2cf5e3 branches/zip:
Add the transaction's weight to information_schema.innodb_trx table.

Suggested by:	Ken
Approved by:	Heikki
2007-11-28 07:07:23 +00:00
vasil
759af55181 branches/zip:
Fix the size of the static buffer for lock_table and lock_index.
I was not realizing that NAME_LEN contains the mbmaxlen multiplier and thus
a quote, when converted to 2 quotes, will take 2 bytes while there are 3
bytes reserved.

Spotted by:	Marko
Pointyhat to:	Vasil
2007-11-21 17:15:27 +00:00
vasil
5cd14d70bc branches/zip:
Fix a bug where the static buffer for innodb_locks.lock_table may not
have enough space.

Pointyhat to:	Marko
2007-11-21 12:11:04 +00:00
vasil
6edf3ef181 branches/zip:
Bugfix1: Set innodb_locks.lock_index to NOT NULL.
If a column in INFORMATION_SCHEMA table has the flag
MY_I_S_MAYBE_NULL and it is not explicitly marked as NOT NULL
with the method ::set_notnull() then it is always rendered as
NULL by MySQL.

Bugfix2: Avoid crashes if lock_index is NULL. It is NULL for table
level locks.

Pointyhat to:	Marko
2007-11-21 12:01:36 +00:00
vasil
30d19bf45f branches/zip:
Non-functional change:
Fix consistency of the sizeof() operator with the rest of i_s.cc

Pointyhat to:	Marko
2007-11-21 11:44:36 +00:00
marko
e1eb788f73 branches/zip: INFORMATION_SCHEMA.INNODB_LOCKS: Quote lock_table, lock_index.
innodb_information_schema.test. Add tests that display most columns from
INFORMATION_SCHEMA.INNODB_LOCKS.  Test that quoting of table names works
and respects SQL_MODE='ANSI_QUOTES'.

innobase_print_identifier(): Remove.

innobase_convert_identifier(): New function,
based on innobase_print_identifier().

innobase_convert_name(): New function, similar to ut_print_namel(), but
using a memory buffer.

ut_print_namel(): Use innobase_convert_name().

fill_innodb_locks_from_cache(): Convert lock_table and lock_index by
calling innobase_convert_name().
2007-11-21 08:46:11 +00:00
vasil
3dfa05681a branches/zip:
Convert INFORMATION_SCHEMA tables' names to upper case so that they are
consistent with other INFORMATION_SCHEMA tables.

 mysql> show tables;
 +---------------------------------------+
 | Tables_in_information_schema          |
 +---------------------------------------+
 | CHARACTER_SETS                        | 
 | COLLATIONS                            | 
 | COLLATION_CHARACTER_SET_APPLICABILITY | 
 | COLUMNS                               | 
 | COLUMN_PRIVILEGES                     | 
 | ENGINES                               | 
 | EVENTS                                | 
 | FILES                                 | 
 | GLOBAL_STATUS                         | 
 | GLOBAL_VARIABLES                      | 
 | KEY_COLUMN_USAGE                      | 
 | PARTITIONS                            | 
 | PLUGINS                               | 
 | PROCESSLIST                           | 
 | REFERENTIAL_CONSTRAINTS               | 
 | ROUTINES                              | 
 | SCHEMATA                              | 
 | SCHEMA_PRIVILEGES                     | 
 | SESSION_STATUS                        | 
 | SESSION_VARIABLES                     | 
 | STATISTICS                            | 
 | TABLES                                | 
 | TABLE_CONSTRAINTS                     | 
 | TABLE_PRIVILEGES                      | 
 | TRIGGERS                              | 
 | USER_PRIVILEGES                       | 
 | VIEWS                                 | 
 | innodb_zip_reset                      | 
 | innodb_trx                            | 
 | innodb_locks                          | 
 | innodb_lock_waits                     | 
 | innodb_zip                            | 
 +---------------------------------------+
2007-11-21 07:38:56 +00:00
vasil
5cbf4e3840 branches/zip:
Implement a limit on the memory used by the INNODB_TRX, INNODB_LOCKS and
INNODB_LOCK_WAITS tables. The maximum allowed memory is defined with the
macro TRX_I_S_MEM_LIMIT.

Approved by:	Marko (via IM)
2007-11-16 13:12:13 +00:00
vasil
e7c63e2c15 branches/zip:
Add the query in information_schema.innodb_trx.trx_query. Add it even
though it is available in information_schema.processlist.info to make
inconsistencies between those two tables obvious.

It is rather confusting to see a transaction shown in innodb_trx and
innodb_locks that holds a lock on one table and the corresponding query
in processlist executing INSERT on another table. We do not want users
to contact us asking to explain that. It is caused by the fact that the
data for innodb_* tables and processlist is fetched at different time.

Approved by:	Marko
2007-11-07 20:38:07 +00:00
marko
2a106e0f3a branches/zip: Deny non-superuser access to the INFORMATION_SCHEMA
tables INNODB_ZIP and INNODB_ZIP_RESET.
2007-11-07 08:44:07 +00:00
vasil
1482a2d223 branches/zip:
Deny access to TRX INFORMATION_SCHEMA tables to non-superusers.

Approved by:	Marko
2007-11-05 14:17:07 +00:00
marko
1bfa27fb91 branches/zip: Remove warnings for BUILD/compile-... --warning-mode=pedantic.
ha_innobase::write_row(): The printf format %p expects const void*.

STRUCT_FLD: Do not use the GCC extension when __STRICT_ANSI__ is defined.

row_merge_read_clustered_index(): Compound initializers must not contain
variables.  Assign to struct fields instead.
2007-11-01 11:44:49 +00:00
vasil
0028e8d1ee branches/zip:
Add innodb_locks.lock_data column and some relevant tests.
For record locks this column represents the ordering fields of the
locked row in a human readable, SQL-valid, format.

Approved by:	Marko
2007-10-29 13:03:53 +00:00
vasil
51f09f6447 branches/zip:
Make lock_get_type_str() to also indicate if it is a gap lock.
 
Suggested by:	Heikki
Approved by:	Marko
2007-10-25 11:21:11 +00:00
vasil
123c147dd7 branches/zip:
Non-functional change to improve readability.
2007-10-11 10:45:57 +00:00
marko
ac57f9244e branches/zip: i_s.cc: Add missing #include "buf0buf.h" that should have
been added in r1943.  This is needed for building a noninlined version.
2007-10-05 10:59:34 +00:00
marko
da66c9dd40 branches/zip: Move the implementation of the INFORMATION_SCHEMA tables
INNODB_ZIP and INNODB_ZIP_RESET from ha_innodb.cc to i_s.cc.

plugin_author, END_OF_ST_FIELD_INFO, i_s_info: New common constants.

trx_i_s_common_deinit(): Renamed to i_s_common_deinit().
2007-10-03 14:00:54 +00:00
marko
252cd110ff branches/zip: Initialize also the newly added field open_method
in ST_FIELD_INFO.
2007-10-03 13:48:17 +00:00
vasil
69a2345cbb Implement INFORMATION_SCHEMA tables innodb_trx, innodb_locks,
innodb_lock_waits. See
https://svn.innodb.com/innobase/InformationSchema/TransactionsAndLocks
for design notes.

Things that need to be resolved before this goes live:
* MySQL must add thd_get_thread_id() function to their code
  http://bugs.mysql.com/30930
* Allocate memory from mem_heap instead of using mem_alloc()
* Copy table name and index name into the cache because they may be
  freed later which will result in referencing freed memory

Approved by:	Marko
2007-09-20 11:23:44 +00:00