Loading Docs/manual.texi +87 −10 Original line number Diff line number Diff line Loading @@ -3554,10 +3554,13 @@ string) in it instead. (This behaviour can, however, be changed with the -DDONT_USE_DEFAULT_FIELDS compile option.) @item MySQL allows you to store some wrong date values into @code{DATE} and @code{DATETIME} columns (like 2000-02-31 or 2000-02-00). If the date is totally wrong, MySQL Server will store the special 0000-00-00 date value in the column. MySQL allows you to store some wrong date values into @code{DATE} and @code{DATETIME} columns (like 2000-02-31 or 2000-02-00). The idea is that it's not the SQL server job to vaildate date. If MySQL can store a date and retrieve exactly the same date, then MySQL will store the date. If the date is totally wrong (outside of MySQL abilty to store it), MySQL Server will store the special 0000-00-00 date value in the column. @item If you set an @code{ENUM} column to an unsupported value, it will be set to Loading Loading @@ -8170,6 +8173,9 @@ Renamed mysqld startup options @code{--skip-locking} to @code{--skip-external-locking} and @code{--enable-locking} to @code{--external-locking}. @item mysqld now has the option @code{--temp-pool} enabled by default as this gives better performance with some OS. @item @code{DOUBLE} and @code{FLOAT} columns now honour the @code{UNSIGNED} flag on storage (before, @code{UNSIGNED} was ignored for these columns). Loading Loading @@ -32555,6 +32561,31 @@ mysql> SELECT WEEK('1998-12-31',1); Note: in Version 4.0, @code{WEEK(#,0)} was changed to match the calendar in the USA. Note that if a week is the last week of the previous year, MySQL will return 0: @example mysql> SELECT YEAR('2000-01-01'), WEEK('2000-01-01',0); -> 2000, 0 @end example One could argue that MySQL should return @code{52} for the @code{WEEK()} function as the given date is actually the 52 second week of 1999. We decided to return 0 instead as we want the function to return 'the week number in the given year'. This makes the usage of the @code{WEEK()} function reliable when combined with other functions that extracts a date part from a date. If you would prefer to know the correct year-week, then you should use the @code{YEARWEEK()} function instead: @example mysql> SELECT YEARWEEK('2000-01-01'); -> 199952 mysql> SELECT MID(YEARWEEK('2000-01-01'),5,2); -> 52 @end example @findex YEAR() @item YEAR(date) Returns the year for @code{date}, in the range @code{1000} to @code{9999}: Loading @@ -32576,6 +32607,10 @@ mysql> SELECT YEARWEEK('1987-01-01'); -> 198653 @end example Note that the week number is different from what the @code{WEEK()} function would return (@code{0}) as the week function returns the week in the context of the given year. @findex HOUR() @item HOUR(time) Returns the hour for @code{time}, in the range @code{0} to @code{23}: Loading Loading @@ -48180,13 +48215,33 @@ mysql> SELECT idate FROM tbl_name WHERE STRCMP(idate,'19970505')=0; a string and performs a string comparison. It does not convert @code{'19970505'} to a date and perform a date comparison. Note that MySQL does no checking whether the date is Note that MySQL does very limited checking whether the date is correct. If you store an incorrect date, such as @code{'1998-2-31'}, the wrong date will be stored. If the date cannot be converted to any reasonable value, a @code{0} is stored in the @code{DATE} field. This is mainly a speed issue and we think it is up to the application to check the dates, and not the server. wrong date will be stored. Because MySQL packs dates for storage, it can't store any given date as it would not fit onto the result buffer. The rules for accepting a date are: @itemize @bullet @item If MySQL can store it and retrieve a date, the wrong date is accepted for @code{DATE} and @code{DATETIME} columns. @item All days values between 0-31 are accepted for any date. This makes it very convenient for web applications where you ask year, month and day in 3 different fields. @item The day or month field may be zero. This is convenient if you want to store a birthdate in a @code{DATE} column and you only know part of the date. @end itemize If the date cannot be converted to any reasonable value, a @code{0} is stored in the @code{DATE} field, which will be retrieved as @code{0000-00-00}. This is both a speed and convinient issue as we belive that the databases responsiblity etrive the same date you stored (even if the data was not logicall correct in all cases). We think it is up to the application to check the dates, and not the server. @node Problems with NULL, Problems with alias, Using DATE, Query Issues @appendixsubsec Problems with @code{NULL} Values Loading Loading @@ -50171,6 +50226,9 @@ Fixed security bug in database hash @item Fixed create table from any ITEM_FUNC and reverted a patch for month() @item mysqld now has the option @code{--temp-pool} enabled by default as this gives better performance with some OS. @item Big code cleanup in replication code. @item If one specifies @code{--code-file}, call @code{setrlmit()} to change allowed Loading Loading @@ -50808,6 +50866,23 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.52 @itemize @bullet @item Fixed a security bug with empty db column in db table @item Changed initialisation of @code{RND()} to make it less predicatable. @item Fixed problem with @code{GROUP BY} on result with expression that created a @code{BLOB} field. @item Fixed problem with privilege tables when downgrading from 4.0.2 to 3.23. @item Fixed thread bug in @code{SLAVE START}, @code{SLAVE STOP} and automatic repair of MyISAM tables that could cause table cache to be corrupted. @item Fixed possible thread related key-cache-corruption problem with @code{OPTIMIZE TABLE} and @code{REPAIR TABLE}. @item Added name of 'administrator command' logs. @item Fixed bug with creating an auto-increment value on second part of a @code{UNIQUE()} key where first part could contain NULL values. @item Loading @@ -50815,7 +50890,9 @@ Don't write slave-timeout reconnects to the error log. @item Fixed bug with slave net read timeouting @item Fixed bug in ALTERing TABLE of BDB type. Fixed a core-dump bug with @code{MERGE} tables and @code{MAX()} function. @item Fixed bug in @code{ALTER TABLE} with BDB tables. @item Fixed bug when logging @code{LOAD DATA INFILE} to binary log with no active database. configure.in +13 −0 Original line number Diff line number Diff line Loading @@ -1554,6 +1554,17 @@ AC_SUBST(TERMCAP_LIB) ######################################################################### dnl Checks for library functions. # # The following code disables intrinsic function support while we test for # library functions. This is to avoid configure problems with Intel ecc # compiler ORG_CFLAGS="$CFLAGS" if test "$GCC" != "yes"; then AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[]) fi AC_FUNC_MMAP AC_TYPE_SIGNAL MYSQL_TYPE_QSORT Loading @@ -1576,6 +1587,8 @@ AC_CHECK_FUNCS(alarm bmove \ pthread_condattr_create rwlock_init pthread_rwlock_rdlock \ fchmod getpass getpassphrase initgroups mlockall) CFLAGS="$ORG_CFLAGS" # Sanity check: We chould not have any fseeko symbol unless # large_file_support=yes AC_CHECK_FUNCS(fseeko, Loading include/my_global.h +11 −13 Original line number Diff line number Diff line Loading @@ -121,14 +121,6 @@ /* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ #endif #ifdef __QNXNTO__ #define HAVE_ERRNO_AS_DEFINE #define HAVE_FCNTL_LOCK #undef HAVE_SYS_UN_H #undef HAVE_FINITE #undef HAVE_RINT #endif #ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ #undef HAVE_SNPRINTF #endif Loading Loading @@ -253,6 +245,17 @@ #define setrlimit cma_setrlimit64 #endif #ifdef __QNXNTO__ /* This has to be after include limits.h */ #define HAVE_ERRNO_AS_DEFINE #define HAVE_FCNTL_LOCK #undef HAVE_SYS_UN_H #undef HAVE_FINITE #undef HAVE_RINT #undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ #undef LONGLONG_MAX /* standard system library 'limits.h' */ #endif /* We can not live without the following defines */ #define USE_MYFUNC 1 /* Must use syscall indirection */ Loading Loading @@ -548,11 +551,6 @@ extern double my_atof(const char*); #define HAVE_LONG_LONG 1 #endif #ifdef __QNXNTO__ #undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ #undef LONGLONG_MAX /* standard system library 'limits.h' */ #endif #if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) #define LONGLONG_MIN ((long long) 0x8000000000000000LL) #define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) Loading include/my_pthread.h +2 −1 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res); #if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) #undef pthread_cond_timedwait #undef pthread_mutex_trylock #define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c)) #define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a)) int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, Loading include/my_semaphore.h +2 −4 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ C_MODE_START #ifdef HAVE_SEMAPHORE_H #include <semaphore.h> #elif defined(__bsdi__) #include <sys/errno.h> #else #ifdef __WIN__ typedef HANDLE sem_t; #else Loading @@ -45,7 +43,7 @@ typedef struct { pthread_cond_t cond; uint count; } sem_t; #endif #endif /* __WIN__ */ int sem_init(sem_t * sem, int pshared, unsigned int value); int sem_destroy(sem_t * sem); Loading @@ -55,7 +53,7 @@ int sem_post(sem_t * sem); int sem_post_multiple(sem_t * sem, unsigned int count); int sem_getvalue(sem_t * sem, unsigned int * sval); #endif #endif /* !__bsdi__ */ C_MODE_END #endif /* !_my_semaphore_h_ */ Loading
Docs/manual.texi +87 −10 Original line number Diff line number Diff line Loading @@ -3554,10 +3554,13 @@ string) in it instead. (This behaviour can, however, be changed with the -DDONT_USE_DEFAULT_FIELDS compile option.) @item MySQL allows you to store some wrong date values into @code{DATE} and @code{DATETIME} columns (like 2000-02-31 or 2000-02-00). If the date is totally wrong, MySQL Server will store the special 0000-00-00 date value in the column. MySQL allows you to store some wrong date values into @code{DATE} and @code{DATETIME} columns (like 2000-02-31 or 2000-02-00). The idea is that it's not the SQL server job to vaildate date. If MySQL can store a date and retrieve exactly the same date, then MySQL will store the date. If the date is totally wrong (outside of MySQL abilty to store it), MySQL Server will store the special 0000-00-00 date value in the column. @item If you set an @code{ENUM} column to an unsupported value, it will be set to Loading Loading @@ -8170,6 +8173,9 @@ Renamed mysqld startup options @code{--skip-locking} to @code{--skip-external-locking} and @code{--enable-locking} to @code{--external-locking}. @item mysqld now has the option @code{--temp-pool} enabled by default as this gives better performance with some OS. @item @code{DOUBLE} and @code{FLOAT} columns now honour the @code{UNSIGNED} flag on storage (before, @code{UNSIGNED} was ignored for these columns). Loading Loading @@ -32555,6 +32561,31 @@ mysql> SELECT WEEK('1998-12-31',1); Note: in Version 4.0, @code{WEEK(#,0)} was changed to match the calendar in the USA. Note that if a week is the last week of the previous year, MySQL will return 0: @example mysql> SELECT YEAR('2000-01-01'), WEEK('2000-01-01',0); -> 2000, 0 @end example One could argue that MySQL should return @code{52} for the @code{WEEK()} function as the given date is actually the 52 second week of 1999. We decided to return 0 instead as we want the function to return 'the week number in the given year'. This makes the usage of the @code{WEEK()} function reliable when combined with other functions that extracts a date part from a date. If you would prefer to know the correct year-week, then you should use the @code{YEARWEEK()} function instead: @example mysql> SELECT YEARWEEK('2000-01-01'); -> 199952 mysql> SELECT MID(YEARWEEK('2000-01-01'),5,2); -> 52 @end example @findex YEAR() @item YEAR(date) Returns the year for @code{date}, in the range @code{1000} to @code{9999}: Loading @@ -32576,6 +32607,10 @@ mysql> SELECT YEARWEEK('1987-01-01'); -> 198653 @end example Note that the week number is different from what the @code{WEEK()} function would return (@code{0}) as the week function returns the week in the context of the given year. @findex HOUR() @item HOUR(time) Returns the hour for @code{time}, in the range @code{0} to @code{23}: Loading Loading @@ -48180,13 +48215,33 @@ mysql> SELECT idate FROM tbl_name WHERE STRCMP(idate,'19970505')=0; a string and performs a string comparison. It does not convert @code{'19970505'} to a date and perform a date comparison. Note that MySQL does no checking whether the date is Note that MySQL does very limited checking whether the date is correct. If you store an incorrect date, such as @code{'1998-2-31'}, the wrong date will be stored. If the date cannot be converted to any reasonable value, a @code{0} is stored in the @code{DATE} field. This is mainly a speed issue and we think it is up to the application to check the dates, and not the server. wrong date will be stored. Because MySQL packs dates for storage, it can't store any given date as it would not fit onto the result buffer. The rules for accepting a date are: @itemize @bullet @item If MySQL can store it and retrieve a date, the wrong date is accepted for @code{DATE} and @code{DATETIME} columns. @item All days values between 0-31 are accepted for any date. This makes it very convenient for web applications where you ask year, month and day in 3 different fields. @item The day or month field may be zero. This is convenient if you want to store a birthdate in a @code{DATE} column and you only know part of the date. @end itemize If the date cannot be converted to any reasonable value, a @code{0} is stored in the @code{DATE} field, which will be retrieved as @code{0000-00-00}. This is both a speed and convinient issue as we belive that the databases responsiblity etrive the same date you stored (even if the data was not logicall correct in all cases). We think it is up to the application to check the dates, and not the server. @node Problems with NULL, Problems with alias, Using DATE, Query Issues @appendixsubsec Problems with @code{NULL} Values Loading Loading @@ -50171,6 +50226,9 @@ Fixed security bug in database hash @item Fixed create table from any ITEM_FUNC and reverted a patch for month() @item mysqld now has the option @code{--temp-pool} enabled by default as this gives better performance with some OS. @item Big code cleanup in replication code. @item If one specifies @code{--code-file}, call @code{setrlmit()} to change allowed Loading Loading @@ -50808,6 +50866,23 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.52 @itemize @bullet @item Fixed a security bug with empty db column in db table @item Changed initialisation of @code{RND()} to make it less predicatable. @item Fixed problem with @code{GROUP BY} on result with expression that created a @code{BLOB} field. @item Fixed problem with privilege tables when downgrading from 4.0.2 to 3.23. @item Fixed thread bug in @code{SLAVE START}, @code{SLAVE STOP} and automatic repair of MyISAM tables that could cause table cache to be corrupted. @item Fixed possible thread related key-cache-corruption problem with @code{OPTIMIZE TABLE} and @code{REPAIR TABLE}. @item Added name of 'administrator command' logs. @item Fixed bug with creating an auto-increment value on second part of a @code{UNIQUE()} key where first part could contain NULL values. @item Loading @@ -50815,7 +50890,9 @@ Don't write slave-timeout reconnects to the error log. @item Fixed bug with slave net read timeouting @item Fixed bug in ALTERing TABLE of BDB type. Fixed a core-dump bug with @code{MERGE} tables and @code{MAX()} function. @item Fixed bug in @code{ALTER TABLE} with BDB tables. @item Fixed bug when logging @code{LOAD DATA INFILE} to binary log with no active database.
configure.in +13 −0 Original line number Diff line number Diff line Loading @@ -1554,6 +1554,17 @@ AC_SUBST(TERMCAP_LIB) ######################################################################### dnl Checks for library functions. # # The following code disables intrinsic function support while we test for # library functions. This is to avoid configure problems with Intel ecc # compiler ORG_CFLAGS="$CFLAGS" if test "$GCC" != "yes"; then AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[]) fi AC_FUNC_MMAP AC_TYPE_SIGNAL MYSQL_TYPE_QSORT Loading @@ -1576,6 +1587,8 @@ AC_CHECK_FUNCS(alarm bmove \ pthread_condattr_create rwlock_init pthread_rwlock_rdlock \ fchmod getpass getpassphrase initgroups mlockall) CFLAGS="$ORG_CFLAGS" # Sanity check: We chould not have any fseeko symbol unless # large_file_support=yes AC_CHECK_FUNCS(fseeko, Loading
include/my_global.h +11 −13 Original line number Diff line number Diff line Loading @@ -121,14 +121,6 @@ /* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ #endif #ifdef __QNXNTO__ #define HAVE_ERRNO_AS_DEFINE #define HAVE_FCNTL_LOCK #undef HAVE_SYS_UN_H #undef HAVE_FINITE #undef HAVE_RINT #endif #ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ #undef HAVE_SNPRINTF #endif Loading Loading @@ -253,6 +245,17 @@ #define setrlimit cma_setrlimit64 #endif #ifdef __QNXNTO__ /* This has to be after include limits.h */ #define HAVE_ERRNO_AS_DEFINE #define HAVE_FCNTL_LOCK #undef HAVE_SYS_UN_H #undef HAVE_FINITE #undef HAVE_RINT #undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ #undef LONGLONG_MAX /* standard system library 'limits.h' */ #endif /* We can not live without the following defines */ #define USE_MYFUNC 1 /* Must use syscall indirection */ Loading Loading @@ -548,11 +551,6 @@ extern double my_atof(const char*); #define HAVE_LONG_LONG 1 #endif #ifdef __QNXNTO__ #undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ #undef LONGLONG_MAX /* standard system library 'limits.h' */ #endif #if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) #define LONGLONG_MIN ((long long) 0x8000000000000000LL) #define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) Loading
include/my_pthread.h +2 −1 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res); #if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) #undef pthread_cond_timedwait #undef pthread_mutex_trylock #define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c)) #define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a)) int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, Loading
include/my_semaphore.h +2 −4 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ C_MODE_START #ifdef HAVE_SEMAPHORE_H #include <semaphore.h> #elif defined(__bsdi__) #include <sys/errno.h> #else #ifdef __WIN__ typedef HANDLE sem_t; #else Loading @@ -45,7 +43,7 @@ typedef struct { pthread_cond_t cond; uint count; } sem_t; #endif #endif /* __WIN__ */ int sem_init(sem_t * sem, int pshared, unsigned int value); int sem_destroy(sem_t * sem); Loading @@ -55,7 +53,7 @@ int sem_post(sem_t * sem); int sem_post_multiple(sem_t * sem, unsigned int count); int sem_getvalue(sem_t * sem, unsigned int * sval); #endif #endif /* !__bsdi__ */ C_MODE_END #endif /* !_my_semaphore_h_ */