Commit 55a6911b authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Portability fixes.

parent 193ae61f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ if ($opt_stage <= 1)

if ($opt_stage <= 2)
{
  unlink($opt_distribution) if (!$opt_delete && !$opt_use_old_distribution);
  unlink($opt_distribution) if ($opt_delete && !$opt_use_old_distribution);
  safe_system("$make");
}

+44 −3
Original line number Diff line number Diff line
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ connect (slave,localhost,root,,test,0,mysql-slave.sock);
connection master;
reset master;
grant file on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant file on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave;
slave start;
connection master;
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ uint my_b_fill(IO_CACHE *info)
** Read a string ended by '\n' into a buffer of 'max_length' size.
** Returns number of characters read, 0 on error.
** last byte is set to '\0'
** If buffer is full then to[max_length-1] will be set to \0.
*/

uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
+1 −1
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ Item_sum_hybrid::min_max_update_int_field(int offset)
		(ulonglong) old_nr > (ulonglong) nr :
		old_nr > nr);
      /* (cmp_sign > 0 && res) || (!(cmp_sign > 0) && !res) */
      if (cmp_sign > 0 ^ !res)
      if ((cmp_sign > 0) ^ (!res))
	old_nr=nr;
    }
    result_field->set_notnull();
Loading