Loading Docs/manual.texi +20 −6 Original line number Diff line number Diff line Loading @@ -8133,15 +8133,17 @@ than it had in 3.23. @item The result of all bitwise operators @code{|}, @code{&}, @code{<<}, @code{>>} and @code{~} is now unsigned. This may cause problems if your are using them in a context where you want an signed result. @xref{Cast Functions}. are using them in a context where you want an signed result. @xref{Cast Functions}. @item @strong{NOTE:} When you use subtraction between integers values where one is of type @code{UNSIGNED}, the result will be unsigned! In other words, before upgrading to MySQL 4.0, you should check your application for cases where you are subtracting a value from an unsigned entity and want a negative answer or subtracting an unsigned value from a an integer column. @xref{Cast Functions}. for cases where you are subtracting a value from an unsigned entity and want a negative answer or subtracting an unsigned value from a an integer column. You can disable this behaviour by using the @code{--sql-mode=NO_UNSIGNED_SUBTRACTION} option when starting @code{mysqld}. @xref{Cast Functions}. @item To use @code{MATCH ... AGAINST (... IN BOOLEAN MODE)} with your tables, you need to rebuild them with @code{ALTER TABLE table_name TYPE=MyISAM}, Loading Loading @@ -19873,6 +19875,8 @@ Means that the thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, then you should check that you don't have a full disk or that the disk is not in very heavy use. @item @code{Connect Out} Slave connecting to master. @item @code{Copying to tmp table on disk} The temporary result set was larger than @code{tmp_table_size} and the thread is now changing the in memory based temporary table to a disk Loading Loading @@ -32000,6 +32004,12 @@ SELECT (unsigned_column_1+0.0)-(unsigned_column_2+0.0); The idea is that the columns are converted to floating point before doing the subtraction. If you get a problem with @code{UNSIGNED} columns in your old MySQL application when porting to MySQL 4.0, you can use the @code{--sql-mode=NO_UNSIGNED_SUBTRACTION} option when starting @code{mysqld}. Note however that as long as you use this, you will not be able to efficiently use the @code{UNSIGNED BIGINT} column type. @node Other Functions, Group by functions, Cast Functions, Functions @subsection Other Functions Loading Loading @@ -48361,6 +48371,10 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item Added sql-mode flag @code{NO_UNSIGNED_SUBTRACTION} to disable unsigned arithmetic rules when it comes to subtraction. (This will make MySQL 4.0 behave more closely to 3.23 with @code{UNSIGNED} columns). @item Added @code{WITH MAX_QUERIES_PER_HOUR=#} to @code{GRANT} command. @item The type returned for all bit functions (@code{|}, @code{<<} ...) are now of Loading Loading @@ -48473,7 +48487,7 @@ Added support for @code{MATCH ... AGAINST(... IN BOOLEAN MODE)}. @code{ALTER TABLE tablename TYPE=MyISAM} to be able to use boolean fulltext search}. @item @code{LOCATE()} and @code{INSTR()} are case sensitive if neither @code{LOCATE()} and @code{INSTR()} are now case sensitive if either argument is a binary string. @item Changed @code{RAND()} initialization so that @code{RAND(N)} and sql/item_func.cc +15 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,21 @@ longlong Item_func_plus::val_int() return (longlong) Item_func_plus::val(); } /* The following function is here to allow the user to force subtraction of UNSIGNED BIGINT to return negative values. */ void Item_func_minus::fix_length_and_dec() { Item_num_op::fix_length_and_dec(); if (unsigned_flag && (current_thd->sql_mode & MODE_NO_UNSIGNED_SUBTRACTION)) unsigned_flag=0; } double Item_func_minus::val() { double value=args[0]->val() - args[1]->val(); Loading sql/item_func.h +2 −0 Original line number Diff line number Diff line Loading @@ -233,8 +233,10 @@ class Item_func_minus :public Item_num_op const char *func_name() const { return "-"; } double val(); longlong val_int(); void fix_length_and_dec(); }; class Item_func_mul :public Item_num_op { public: Loading sql/mysql_priv.h +7 −6 Original line number Diff line number Diff line Loading @@ -187,6 +187,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); #define MODE_IGNORE_SPACE 8 #define MODE_SERIALIZABLE 16 #define MODE_ONLY_FULL_GROUP_BY 32 #define MODE_NO_UNSIGNED_SUBTRACTION 64 #define RAID_BLOCK_SIZE 1024 Loading sql/mysqld.cc +3 −3 Original line number Diff line number Diff line Loading @@ -351,7 +351,7 @@ time_t start_time; ulong opt_sql_mode = 0L; const char *sql_mode_names[] = { "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE", "SERIALIZE","ONLY_FULL_GROUP_BY", NullS }; "SERIALIZE","ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",NullS }; TYPELIB sql_mode_typelib= {array_elements(sql_mode_names)-1,"", sql_mode_names}; Loading Loading @@ -486,7 +486,6 @@ static void close_connections(void) HANDLE hTempPipe = &hPipe; DBUG_PRINT( "quit", ("Closing named pipes") ); hPipe = INVALID_HANDLE_VALUE; CancelIo( hTempPipe ); DisconnectNamedPipe( hTempPipe ); CloseHandle( hTempPipe ); } Loading Loading @@ -3411,7 +3410,8 @@ static void usage(void) -t, --tmpdir=path Path for temporary files\n\ --sql-mode=option[,option[,option...]] where option can be one of:\n\ REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES,\n\ IGNORE_SPACE, SERIALIZE, ONLY_FULL_GROUP_BY.\n\ IGNORE_SPACE, SERIALIZE, ONLY_FULL_GROUP_BY,\n\ NO_UNSIGNED_SUBTRACTION.\n\ --transaction-isolation\n\ Default transaction isolation level\n\ --temp-pool Use a pool of temporary files\n\ Loading Loading
Docs/manual.texi +20 −6 Original line number Diff line number Diff line Loading @@ -8133,15 +8133,17 @@ than it had in 3.23. @item The result of all bitwise operators @code{|}, @code{&}, @code{<<}, @code{>>} and @code{~} is now unsigned. This may cause problems if your are using them in a context where you want an signed result. @xref{Cast Functions}. are using them in a context where you want an signed result. @xref{Cast Functions}. @item @strong{NOTE:} When you use subtraction between integers values where one is of type @code{UNSIGNED}, the result will be unsigned! In other words, before upgrading to MySQL 4.0, you should check your application for cases where you are subtracting a value from an unsigned entity and want a negative answer or subtracting an unsigned value from a an integer column. @xref{Cast Functions}. for cases where you are subtracting a value from an unsigned entity and want a negative answer or subtracting an unsigned value from a an integer column. You can disable this behaviour by using the @code{--sql-mode=NO_UNSIGNED_SUBTRACTION} option when starting @code{mysqld}. @xref{Cast Functions}. @item To use @code{MATCH ... AGAINST (... IN BOOLEAN MODE)} with your tables, you need to rebuild them with @code{ALTER TABLE table_name TYPE=MyISAM}, Loading Loading @@ -19873,6 +19875,8 @@ Means that the thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, then you should check that you don't have a full disk or that the disk is not in very heavy use. @item @code{Connect Out} Slave connecting to master. @item @code{Copying to tmp table on disk} The temporary result set was larger than @code{tmp_table_size} and the thread is now changing the in memory based temporary table to a disk Loading Loading @@ -32000,6 +32004,12 @@ SELECT (unsigned_column_1+0.0)-(unsigned_column_2+0.0); The idea is that the columns are converted to floating point before doing the subtraction. If you get a problem with @code{UNSIGNED} columns in your old MySQL application when porting to MySQL 4.0, you can use the @code{--sql-mode=NO_UNSIGNED_SUBTRACTION} option when starting @code{mysqld}. Note however that as long as you use this, you will not be able to efficiently use the @code{UNSIGNED BIGINT} column type. @node Other Functions, Group by functions, Cast Functions, Functions @subsection Other Functions Loading Loading @@ -48361,6 +48371,10 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item Added sql-mode flag @code{NO_UNSIGNED_SUBTRACTION} to disable unsigned arithmetic rules when it comes to subtraction. (This will make MySQL 4.0 behave more closely to 3.23 with @code{UNSIGNED} columns). @item Added @code{WITH MAX_QUERIES_PER_HOUR=#} to @code{GRANT} command. @item The type returned for all bit functions (@code{|}, @code{<<} ...) are now of Loading Loading @@ -48473,7 +48487,7 @@ Added support for @code{MATCH ... AGAINST(... IN BOOLEAN MODE)}. @code{ALTER TABLE tablename TYPE=MyISAM} to be able to use boolean fulltext search}. @item @code{LOCATE()} and @code{INSTR()} are case sensitive if neither @code{LOCATE()} and @code{INSTR()} are now case sensitive if either argument is a binary string. @item Changed @code{RAND()} initialization so that @code{RAND(N)} and
sql/item_func.cc +15 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,21 @@ longlong Item_func_plus::val_int() return (longlong) Item_func_plus::val(); } /* The following function is here to allow the user to force subtraction of UNSIGNED BIGINT to return negative values. */ void Item_func_minus::fix_length_and_dec() { Item_num_op::fix_length_and_dec(); if (unsigned_flag && (current_thd->sql_mode & MODE_NO_UNSIGNED_SUBTRACTION)) unsigned_flag=0; } double Item_func_minus::val() { double value=args[0]->val() - args[1]->val(); Loading
sql/item_func.h +2 −0 Original line number Diff line number Diff line Loading @@ -233,8 +233,10 @@ class Item_func_minus :public Item_num_op const char *func_name() const { return "-"; } double val(); longlong val_int(); void fix_length_and_dec(); }; class Item_func_mul :public Item_num_op { public: Loading
sql/mysql_priv.h +7 −6 Original line number Diff line number Diff line Loading @@ -187,6 +187,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); #define MODE_IGNORE_SPACE 8 #define MODE_SERIALIZABLE 16 #define MODE_ONLY_FULL_GROUP_BY 32 #define MODE_NO_UNSIGNED_SUBTRACTION 64 #define RAID_BLOCK_SIZE 1024 Loading
sql/mysqld.cc +3 −3 Original line number Diff line number Diff line Loading @@ -351,7 +351,7 @@ time_t start_time; ulong opt_sql_mode = 0L; const char *sql_mode_names[] = { "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE", "SERIALIZE","ONLY_FULL_GROUP_BY", NullS }; "SERIALIZE","ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",NullS }; TYPELIB sql_mode_typelib= {array_elements(sql_mode_names)-1,"", sql_mode_names}; Loading Loading @@ -486,7 +486,6 @@ static void close_connections(void) HANDLE hTempPipe = &hPipe; DBUG_PRINT( "quit", ("Closing named pipes") ); hPipe = INVALID_HANDLE_VALUE; CancelIo( hTempPipe ); DisconnectNamedPipe( hTempPipe ); CloseHandle( hTempPipe ); } Loading Loading @@ -3411,7 +3410,8 @@ static void usage(void) -t, --tmpdir=path Path for temporary files\n\ --sql-mode=option[,option[,option...]] where option can be one of:\n\ REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES,\n\ IGNORE_SPACE, SERIALIZE, ONLY_FULL_GROUP_BY.\n\ IGNORE_SPACE, SERIALIZE, ONLY_FULL_GROUP_BY,\n\ NO_UNSIGNED_SUBTRACTION.\n\ --transaction-isolation\n\ Default transaction isolation level\n\ --temp-pool Use a pool of temporary files\n\ Loading