Commit 621b5da8 authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi
Browse files

Fixed bug with GROUP BY on NULL fields.

(Merge of code from 4.0)
parent 8a38deea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -46928,6 +46928,9 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.52
@itemize @bullet
@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} and @code{SLAVE STOP}.
+2 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ enum ha_base_keytype {
#define HA_BINARY_PACK_KEY	 32	/* Packing of all keys to prev key */
#define HA_FULLTEXT		128     /* SerG: for full-text search */
#define HA_UNIQUE_CHECK		256	/* Check the key for uniqueness */
#define HA_NULL_ARE_EQUAL	2048	/* NULL in key are cmp as equal */

	/* Automatic bits in key-flag */

@@ -235,6 +236,7 @@ enum ha_base_keytype {
#define SEARCH_UPDATE	64
#define SEARCH_PREFIX	128
#define SEARCH_LAST	256
#define SEARCH_NULL_ARE_EQUAL 32768	/* NULL in keys are equal */

	/* bits in opt_flag */
#define QUICK_USED	1
+3 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ typedef struct st_vio Vio;
#endif
#endif

#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;
  my_socket fd;					/* For Perl DBI/dbd */
+3 −2
Original line number Diff line number Diff line
@@ -107,8 +107,9 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
  }
  else
  {
    if (nextflag & SEARCH_FIND && (!(keyinfo->flag & HA_NOSAME)
				   || key_len) && nod_flag)
    if ((nextflag & SEARCH_FIND) && nod_flag &&
	((keyinfo->flag & (HA_NOSAME | HA_NULL_PART)) != HA_NOSAME ||
	 key_len))
    {
      if ((error=_mi_search(info,keyinfo,key,key_len,SEARCH_FIND,
			    _mi_kpos(nod_flag,keypos))) >= 0 ||
+4 −0
Original line number Diff line number Diff line
@@ -263,7 +263,11 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
  if (keyinfo->flag & HA_SORT_ALLOWS_SAME)
    comp_flag=SEARCH_BIGGER;			/* Put after same key */
  else if (keyinfo->flag & HA_NOSAME)
  {
    comp_flag=SEARCH_FIND | SEARCH_UPDATE;	/* No dupplicates */
    if (keyinfo->flag & HA_NULL_ARE_EQUAL)
      comp_flag|= SEARCH_NULL_ARE_EQUAL;
  }
  else
    comp_flag=SEARCH_SAME;			/* Keys in rec-pos order */

Loading