summaryrefslogtreecommitdiff
path: root/Docs
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-10-03 17:02:14 +0300
committerunknown <monty@hundin.mysql.fi>2001-10-03 17:02:14 +0300
commit664647d1f7c190f1cc54fb817b10c86f994c1fdc (patch)
treebbfafc773031daba5da578013d4bbd52be39e770 /Docs
parent2e0dc69895280f3b407e56dace32ad9cf25ce356 (diff)
downloadmariadb-git-664647d1f7c190f1cc54fb817b10c86f994c1fdc.tar.gz
Portability fixes.
Build-tools/Do-compile: Don't delete distribution if not using --delete Docs/manual.texi: Added information about default values mysql-test/t/rpl000017.test: Fixed replication test to be more portable mysys/mf_iocache2.c: More comments sql/item_sum.cc: Cleanup sql/log_event.cc: Cleanup sql/mysqld.cc: Fixed typos in output sql/sql_base.cc: Cleanup sql/sql_delete.cc: Cleanup sql/sql_select.cc: Cleanup sql/uniques.cc: Portability fix
Diffstat (limited to 'Docs')
-rw-r--r--Docs/manual.texi47
1 files changed, 44 insertions, 3 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 17aab3c6764..68abd2ca398 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -770,9 +770,11 @@ databases that contain 50,000,000 records and we know of users that
uses MySQL with 60,000 tables and about 5,000,000,000 rows
@item
-All columns have default values. You can use @code{INSERT} to insert a
-subset of a table's columns; those columns that are not explicitly given
-values are set to their default values.
+@cindex default values
+All columns have default values.
+You can use @code{INSERT} to insert a subset of a table's columns; those
+columns that are not explicitly given values are set to their default
+values.
@item
Uses GNU Automake, Autoconf, and Libtool for portability.
@@ -24297,6 +24299,37 @@ takes more effort and hardware.
We are also working on some extensions to solve this problem for some
common application niches.
+MySQL can work with both transactional and not transactional tables. To
+be able to work smoothly with not transactional tables (which can't
+rollback if something goes wrong), MySQL has the following rules:
+
+@cindex default values
+@itemize @bullet
+@item
+All columns has default values.
+@item
+If you insert a 'wrong' value in a column like a @code{NULL} in a
+@code{NOT NULL} column or a too big numerical value in a numerical
+column, MySQL will instead of giving an error instead set the column to
+the 'best possible value'. For numerical values this is 0, the smallest
+possible values or the largest possible value. For strings this is
+either the empty string or the longest possible string that can be in
+the column.
+@item
+All calculated expressions returns a value that can be used instead of
+signaling an error condition. For example 1/0 returns @code{NULL}
+@end itemize
+
+The reason for the above rules is that we can't check these conditions
+before the query starts to execute. If we encounter a problem after
+updating a few rows, we can't just rollback as the table type may not
+support this. We can't stop because in that case the update would be
+'half done' which is probably the worst possible scenario. In this case
+it's better to 'do the best you can' and then continue as if nothing
+happened.
+
+The above means that one should not use MySQL to check fields content,
+but one should do this in the application.
@node Portability, Internal use, Design Limitations, Optimize Overview
@subsection Portability
@@ -32569,11 +32602,18 @@ If you specify no column list for @code{INSERT ... VALUES} or @code{INSERT
the columns in the table, use @code{DESCRIBE tbl_name} to find out.
@item
+@cindex default values
Any column not explicitly given a value is set to its default value. For
example, if you specify a column list that doesn't name all the columns in
the table, unnamed columns are set to their default values. Default value
assignment is described in @ref{CREATE TABLE, , @code{CREATE TABLE}}.
+MySQL always has a default value for all fields. This is something
+that is imposed on MySQL to be able to work with both transactional
+and not transactional tables.
+
+Our view is that checking of fields content should be done in the
+application and not in the database server.
@item
An @code{expression} may refer to any column that was set earlier in a value
list. For example, you can say this:
@@ -33814,6 +33854,7 @@ as setting it to @code{NULL}, because @code{0} is a valid @code{TIMESTAMP}
value.
@item
+@cindex default values
If no @code{DEFAULT} value is specified for a column, MySQL
automatically assigns one.