logo       

bk commit - mysqldoc tree (1.332): msg#00424

db.mysql.devel

Subject: bk commit - mysqldoc tree (1.332)

Below is the list of changes that have just been committed into a local
mysqldoc repository of venu. When venu does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
1.332 03/04/30 00:29:22 venu@xxxxxxxxxx +1 -0
manual.texi:
Updated about warnings

Docs/manual.texi
1.309 03/04/30 00:29:04 venu@xxxxxxxxxx +67 -3
Updated about warnings

# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: venu
# Host: myvenu.com
# Root: /home/venu/bk/doc

--- 1.308/Docs/manual.texi Tue Apr 29 13:01:05 2003
+++ 1.309/Docs/manual.texi Wed Apr 30 00:29:04 2003
@@ -22147,9 +22147,73 @@
@end example

Note that in MySQL 4.1.0 we have just added the frame work for warnings
-and not many MySQL command do yet generate warnings. In 4.1.1 we will
-enable warnings for more commands, in particular @code{LOAD DATA
-INFILE}.
+and not many MySQL command do yet generate warnings. 4.1.1 supports all
+kind of warnings for @code{LOAD DATA INFILE} and DML statements such as
+@code{INSERT}, @code{UPDATE} and @code{ALTER} commands.
+
+For example, here is a simple case which produces conversion warnings
+for a insert statement.
+
+@example
+mysql> create table t1(a tinyint NOT NULL, b char(4));
+Query OK, 0 rows affected (0.00 sec)
+
+mysql> insert into t1 values(10,'mysql'),(NULL,'test'),(300,'open source');
+Query OK, 3 rows affected, 4 warnings (0.15 sec)
+Records: 3 Duplicates: 0 Warnings: 4
+
+mysql> show warnings;
++---------+------+---------------------------------------------------------------+
+| Level | Code | Message
|
++---------+------+---------------------------------------------------------------+
+| Warning | 1263 | Data truncated for column 'b' at row 1
|
+| Warning | 1261 | Data truncated, NULL supplied to NOT NULL column 'a' at row
2 |
+| Warning | 1262 | Data truncated, out of range for column 'a' at row 3
|
+| Warning | 1263 | Data truncated for column 'b' at row 3
|
++---------+------+---------------------------------------------------------------+
+4 rows in set (0.00 sec)
+@end example
+
+
+Maximum number of warnings can be specified using the server variable
+@code{'max_error_count'}, @code{SET max_error_count=[count]}; By default
+it is 64. In case to disable warnings, simply reset this variable to
+'0'. In case if @code{max_error_count} is 0, then still the warning
+count represents how many warnings has occured, but none of the messages
+are stored.
+
+For example, consider the following @code{ALTER} table statement for the
+above example, which returns only one warning message even though total
+warnings occured is 3 when you set max_error_count=1.
+
+@example
+mysql> show variables like 'max_error_count';
++-----------------+-------+
+| Variable_name | Value |
++-----------------+-------+
+| max_error_count | 64 |
++-----------------+-------+
+1 row in set (0.00 sec)
+
+mysql> set max_error_count=1;
+Query OK, 0 rows affected (0.00 sec)
+
+mysql> alter table t1 modify b char;
+Query OK, 3 rows affected, 3 warnings (0.00 sec)
+Records: 3 Duplicates: 0 Warnings: 3
+
+mysql> show warnings;
++---------+------+----------------------------------------+
+| Level | Code | Message |
++---------+------+----------------------------------------+
+| Warning | 1263 | Data truncated for column 'b' at row 1 |
++---------+------+----------------------------------------+
+1 row in set (0.00 sec)
+
+mysql>
+@end example
+
+

@node SHOW TABLE TYPES, SHOW PRIVILEGES, SHOW WARNINGS, SHOW
@subsubsection @code{SHOW TABLE TYPES}

--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:
http://lists.mysql.com/internals?unsub=gcdmd-internals@xxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise