summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-03-27 00:50:54 +0200
committerunknown <monty@hundin.mysql.fi>2002-03-27 00:50:54 +0200
commit6229932f1010c270e2319d8dc3be9670d016546e (patch)
treeb4d119bd6bbc308bc83082b866042975b6b7f35c
parent91443b080b7858e69360d598061b4b8a32211aac (diff)
downloadmariadb-git-6229932f1010c270e2319d8dc3be9670d016546e.tar.gz
support for unsigned FLOAT/DOUBLE
Docs/manual.texi: Updated STRCMP and UNION information configure.in: Portability fix include/config-win.h: Fix for WIN64 include/mysql_com.h: Cleanup libmysql/libmysql.c: Cleanup myisam/ft_boolean_search.c: Cleanup mysys/array.c: Cleanup mysys/thr_alarm.c: Cleanup sql/ha_innodb.cc: Cleanup
-rw-r--r--Docs/manual.texi37
-rw-r--r--configure.in3
-rw-r--r--include/config-win.h2
-rw-r--r--include/mysql_com.h4
-rw-r--r--libmysql/libmysql.c2
-rw-r--r--myisam/ft_boolean_search.c3
-rw-r--r--mysys/array.c3
-rw-r--r--mysys/thr_alarm.c1
-rw-r--r--sql/field.cc25
-rw-r--r--sql/ha_innodb.cc3
10 files changed, 67 insertions, 16 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index d7a7ad91abd..3b090aec68d 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -4532,7 +4532,7 @@ MySQL Server also supports
the following additional type attributes:
@itemize @bullet
@item
-@code{UNSIGNED} option for integer columns.
+@code{UNSIGNED} option for integer and floating point columns.
@item
@code{ZEROFILL} option for integer columns.
@item
@@ -8148,6 +8148,10 @@ version 4.0;
@itemize @bullet
@item
+@code{DOUBLE} and @code{FLOAT} columns are now honoring the
+@code{UNSIGNED} flag on storage (before @code{UNSIGNED} was ignored for
+these columns).
+@item
Use @code{ORDER BY column DESC} now always sorts @code{NULL} values
first; In 3.23 this was not always consistent.
@item
@@ -8177,6 +8181,9 @@ you need to rebuild them with @code{ALTER TABLE table_name TYPE=MyISAM},
@code{LOCATE()} and @code{INSTR()} are case sensitive if one of the
arguments is a binary string.
@item
+@code{STRCMP()} now uses the current character set when doing comparison,
+which means that the default comparison is case insensitive.
+@item
@code{HEX(string)} now returns the characters in string converted to
hexadecimal. If you want to convert a number to hexadecimal, you should
ensure that you call @code{HEX()} with a numeric argument.
@@ -33467,8 +33474,6 @@ restrictions:
@itemize @bullet
@item
Only the last @code{SELECT} command can have @code{INTO OUTFILE}.
-@item
-Only the last @code{SELECT} command can have @code{ORDER BY}.
@end itemize
If you don't use the keyword @code{ALL} for the @code{UNION}, all
@@ -33476,6 +33481,13 @@ returned rows will be unique, like if you had done a @code{DISTINCT} for
the total result set. If you specify @code{ALL}, then you will get all
matching rows from all the used @code{SELECT} statements.
+If you want to use an @code{ORDER BY} for the total @code{UNION} result,
+you should use parentheses:
+
+@example
+(SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10) UNION
+(SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10) ORDER BY a;
+@end example
@findex HANDLER
@node HANDLER, INSERT, SELECT, Data Manipulation
@@ -41741,9 +41753,11 @@ set has been read.
If you acquire a result set from a successful call to
@code{mysql_store_result()}, the client receives the entire set in one
-operation. In this case, a @code{NULL} return from @code{mysql_fetch_row()}
-always means the end of the result set has been reached and it is
-unnecessary to call @code{mysql_eof()}.
+operation. In this case, a @code{NULL} return from
+@code{mysql_fetch_row()} always means the end of the result set has been
+reached and it is unnecessary to call @code{mysql_eof()}. When used
+with @code{mysql_store_result()}, @code{mysql_eof()} will always return
+true.
On the other hand, if you use @code{mysql_use_result()} to initiate a result
set retrieval, the rows of the set are obtained from the server one by one as
@@ -48730,6 +48744,11 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
+A lot of fixes to @code{UNION}.
+@item
+@code{DOUBLE} and @code{FLOAT} columns are now honoring the
+@code{UNSIGNED} flag on storage.
+@item
Fixed bug with indexless boolean fulltext search.
@item
Fixed bug that sometimes appeared when fulltext search was used
@@ -48934,6 +48953,9 @@ now handle signed and unsigned @code{BIGINT} numbers correctly.
@item
New character set @code{latin_de} which provides correct German sorting.
@item
+@code{STRCMP()} now uses the current character set when doing comparison,
+which means that the default comparison is case insensitive.
+@item
@code{TRUNCATE TABLE} and @code{DELETE FROM table_name} are now separate
functions. One bonus is that @code{DELETE FROM table_name} now returns
the number of deleted rows.
@@ -49118,6 +49140,9 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.50
@itemize @bullet
@item
+Our Linux RPMS and binaries are now compiled with gcc 3.0.4, which should
+make them a bit faster.
+@item
Fixed problem with @code{SHOW CREATE TABLE} and @code{PRIMARY KEY} when using
32 indexes.
@item
diff --git a/configure.in b/configure.in
index 3fe235693e9..bb9cb17d418 100644
--- a/configure.in
+++ b/configure.in
@@ -974,7 +974,8 @@ Reference Manual.])
if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
then
with_named_thread="-lpthread -lmach -lexc"
- #with_named_thread="-lpthread -lmach -lexc -lc"
+ CFLAGS="$CFLAGS -D_REENTRANT"
+ CXXFLAGS="$CXXFLAGS -D_REENTRANT"
AC_DEFINE(HAVE_DEC_THREADS)
AC_MSG_RESULT("yes")
else
diff --git a/include/config-win.h b/include/config-win.h
index a3770cd68ad..12a89bec21b 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -31,7 +31,7 @@
#define SYSTEM_TYPE "Win95/Win98"
#endif
-#ifdef _WIN64
+#if defined(_WIN64) || defined(WIN64)
#define MACHINE_TYPE "ia64" /* Define to machine type name */
#else
#define MACHINE_TYPE "i32" /* Define to machine type name */
diff --git a/include/mysql_com.h b/include/mysql_com.h
index cc887cc7c83..c6cc2eee7fa 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -108,8 +108,8 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
struct st_vio; /* Only C */
typedef struct st_vio Vio;
-#define MAX_CHAR_WIDTH 255 // Max length for a CHAR colum
-#define MAX_BLOB_WIDTH 8192 // Default width for blob
+#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */
+#define MAX_BLOB_WIDTH 8192 /* Default width for blob */
typedef struct st_net {
Vio* vio;
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 8c412f88ac7..31b0ea0fb53 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -701,7 +701,7 @@ static const char *default_options[]=
"character-set-dir", "default-character-set", "interactive-timeout",
"connect-timeout", "local-infile", "disable-local-infile",
"replication-probe", "enable-reads-from-master", "repl-parse-query",
- "ssl-chiper",
+ "ssl-cipher",
NullS
};
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 6038a988db6..9b51601be40 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -412,7 +412,6 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
FTB_EXPR *ftbe;
FT_SEG_ITERATOR ftsi;
const byte *end;
- uint i;
my_off_t docid=ftb->info->lastpos;
if (docid == HA_POS_ERROR)
@@ -420,7 +419,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
if (!ftb->queue.elements)
return 0;
-#if 0
+#if NOT_USED
if (ftb->state == READY || ftb->state == INDEX_DONE)
ftb->state=SCAN;
else if (ftb->state != SCAN)
diff --git a/mysys/array.c b/mysys/array.c
index 8bc19b07d4e..2420213d454 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -29,7 +29,8 @@
*/
my_bool _init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
- uint init_alloc, uint alloc_increment CALLER_INFO_PROTO)
+ uint init_alloc,
+ uint alloc_increment CALLER_INFO_PROTO)
{
DBUG_ENTER("init_dynamic_array");
if (!alloc_increment)
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index cdfb09e8fea..ef514efe39e 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -15,6 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* To avoid problems with alarms in debug code, we disable DBUG here */
+#undef DBUG_OFF
#define DBUG_OFF
#include <my_global.h>
diff --git a/sql/field.cc b/sql/field.cc
index 2a0d0160d00..32679f549ba 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1713,6 +1713,11 @@ void Field_float::store(double nr)
float j;
if (dec < NOT_FIXED_DEC)
nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point
+ if (unsigned_flag && nr < 0)
+ {
+ current_thd->cuted_fields++;
+ nr=0;
+ }
if (nr < -FLT_MAX)
{
j= -FLT_MAX;
@@ -1739,6 +1744,11 @@ void Field_float::store(double nr)
void Field_float::store(longlong nr)
{
float j= (float) nr;
+ if (unsigned_flag && j < 0)
+ {
+ current_thd->cuted_fields++;
+ j=0;
+ }
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -1945,6 +1955,11 @@ void Field_double::store(const char *from,uint len)
double j= atof(tmp_str.c_ptr());
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len))
current_thd->cuted_fields++;
+ if (unsigned_flag && j < 0)
+ {
+ current_thd->cuted_fields++;
+ j=0;
+ }
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -1960,6 +1975,11 @@ void Field_double::store(double nr)
{
if (dec < NOT_FIXED_DEC)
nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point
+ if (unsigned_flag && nr < 0)
+ {
+ current_thd->cuted_fields++;
+ nr=0;
+ }
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -1974,6 +1994,11 @@ void Field_double::store(double nr)
void Field_double::store(longlong nr)
{
double j= (double) nr;
+ if (unsigned_flag && j < 0)
+ {
+ current_thd->cuted_fields++;
+ j=0;
+ }
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 4cf06dfb731..287b644b5d3 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2408,7 +2408,7 @@ ha_innobase::rnd_pos(
int error;
uint keynr = active_index;
DBUG_ENTER("rnd_pos");
- DBUG_DUMP("key", pos, ref_stored_len);
+ DBUG_DUMP("key", (char*) pos, ref_stored_len);
statistic_increment(ha_read_rnd_count, &LOCK_status);
@@ -2633,7 +2633,6 @@ ha_innobase::create(
dict_table_t* innobase_table;
trx_t* trx;
int primary_key_no;
- KEY* key;
uint i;
char name2[FN_REFLEN];
char norm_name[FN_REFLEN];