SHOW
Syntax
1203
SHOW VARIABLES LIKE 'max_join_size';
SHOW SESSION VARIABLES LIKE 'max_join_size';
To get a list of variables whose name match a pattern, use the “
%
” wildcard character in a
LIKE
[896]
clause:
SHOW VARIABLES LIKE '%size%';
SHOW GLOBAL VARIABLES LIKE '%size%';
Wildcard characters can be used in any position within the pattern to be matched. Strictly speaking,
because “
_
” is a wildcard that matches any single character, you should escape it as “
\_
” to match it
literally. In practice, this is rarely necessary.
13.7.5.37.
SHOW WARNINGS
Syntax
SHOW WARNINGS [LIMIT [
offset
,]
row_count
]
SHOW COUNT(*) WARNINGS
SHOW WARNINGS
shows information about the conditions (errors, warnings, and notes) that resulted
from the last statement in the current session that generated messages. It shows nothing if the last
statement used a table and generated no messages. (That is, a statement that uses a table but
generates no messages clears the message list.) Statements that do not use tables and do not
generate messages have no effect on the message list.
Warnings are generated for DML statements such as
INSERT
,
UPDATE
, and
LOAD DATA INFILE
as
well as DDL statements such as
CREATE TABLE
and
ALTER TABLE
.
SHOW WARNINGS
is also used following
EXPLAIN EXTENDED
, to display the extra information
generated by
EXPLAIN
when the
EXTENDED
keyword is used. See
Section 8.2.3, “
EXPLAIN
EXTENDED
Output Format”
.
The
LIMIT
clause has the same syntax as for the
SELECT
statement. See
Section 13.2.8, “
SELECT
Syntax”
.
A related statement,
SHOW ERRORS
, shows only the error conditions (it excludes warnings and notes).
See
Section 13.7.5.14, “
SHOW ERRORS
Syntax”
.
The
SHOW COUNT(*) WARNINGS
statement displays the total number of errors, warnings, and notes.
You can also retrieve this number from the
warning_count
[507]
system variable:
SHOW COUNT(*) WARNINGS;
SELECT @@warning_count;
Here is a simple example that shows a syntax warning for
CREATE TABLE
and conversion warnings
for
INSERT
:
mysql>
CREATE TABLE t1
>
(a TINYINT NOT NULL, b CHAR(4))
>
TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>
SHOW WARNINGS\G
*************************** 1. row ***************************
Level: Warning
Code: 1287
Message: 'TYPE=storage_engine' is deprecated, use
'ENGINE=storage_engine' instead
1 row in set (0.00 sec)
mysql>
INSERT INTO t1 VALUES(10,'mysql'),
->
(NULL,'test'), (300,'Open Source');
Query OK, 3 rows affected, 4 warnings (0.01 sec)
Records: 3 Duplicates: 0 Warnings: 4
mysql>
SHOW WARNINGS\G
*************************** 1. row ***************************
Level: Warning
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...