summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@sun.com>2010-03-16 15:51:00 +0100
committerMartin Hansson <martin.hansson@sun.com>2010-03-16 15:51:00 +0100
commit7dc693229fc90dbd9c7744435483cbe1a0767c56 (patch)
treedfcecf32de24bf295b996a6041a1d446bec24d60 /sql/field.h
parent9fc32c2e2441d254ec21d5b0541e468f9d9dd149 (diff)
downloadmariadb-git-7dc693229fc90dbd9c7744435483cbe1a0767c56.tar.gz
Bug#47762: Incorrect result from MIN() when WHERE tests NOT
NULL column for NULL The optimization to read MIN() and MAX() values from an index did not properly handle comparisons with NULL values. Fixed by giving up the particular optimization step if there are non-NULL safe comparisons with NULL values, as the result is NULL anyway. Also, Oracle copyright notice was added to all files.
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/field.h b/sql/field.h
index 55604193687..5bfcc9f21a6 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Because of the function new_field() all field classes that have static
@@ -55,7 +55,11 @@ public:
static void operator delete(void *ptr_arg, size_t size) { TRASH(ptr_arg, size); }
uchar *ptr; // Position to field in record
- uchar *null_ptr; // Byte where null_bit is
+ /**
+ Byte where the @c NULL bit is stored inside a record. If this Field is a
+ @c NOT @c NULL field, this member is @c NULL.
+ */
+ uchar *null_ptr;
/*
Note that you can use table->in_use as replacement for current_thd member
only inside of val_*() and store() members (e.g. you can't use it in cons)
@@ -261,6 +265,9 @@ public:
inline void set_notnull(my_ptrdiff_t row_offset= 0)
{ if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; }
inline bool maybe_null(void) { return null_ptr != 0 || table->maybe_null; }
+ /**
+ Signals that this field is NULL-able.
+ */
inline bool real_maybe_null(void) { return null_ptr != 0; }
enum {