Commit f0e835ac authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Fixed problem with WHERE key=const ORDER BY key DESC

parent 93ab42f6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -9869,6 +9869,9 @@ If you would like MySQL to start automatically, you can copy
@file{support-files/mysql.server} to @file{/etc/init.d} and create a
symbolic link to it named @file{/etc/rc3.d/S99mysql.server}.
As Solaris doesn't support core files for @code{setuid()} applications,
you can't get a core file from @code{mysqld} if you are using the
@code{--user} option.
@menu
* Solaris 2.7::                 Solaris 2.7/2.8 Notes
@@ -14114,7 +14117,8 @@ though.
@item --core-file
Write a core file if @code{mysqld} dies.  For some systems you must also
specify @code{--core-file-size} to @code{safe_mysqld}. @xref{safe_mysqld, ,
@code{safe_mysqld}}.
@code{safe_mysqld}}. Note that on some system like Solaris, you will
not get a core file if you are also using the @code{--user} option.
@item -h, --datadir=path
Path to the database root.
@@ -48732,6 +48736,8 @@ Fixed wrong error value when doing a @code{SELECT} with an empty HEAP table.
@item
Use @code{ORDER BY column DESC} now sorts @code{NULL} values first.
@item
Fixed bug in @code{WHERE key_name='constant' ORDER BY key_name DESC}.
@item
Fixed bug in @code{SELECT DISTINCT ... ORDER BY DESC} optimization.
@item
Fixed bug in @code{... HAVING 'GROUP_FUNCTION'(xxx) IS [NOT] NULL}.
+2 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
  param.prev=' ';
  while ((res=ft_get_word(start,end,&w,&param)))
  {
    byte  r=param.plusminus;
    int  r=param.plusminus;
    float weight= (float) (param.pmsign ? nwghts : wghts)[(r>5)?5:((r<-5)?-5:r)];
    switch (res) {
      case 1: /* word found */
+6 −6
Original line number Diff line number Diff line
@@ -725,10 +725,10 @@ bool ha_myisam::check_and_repair(THD *thd)
  {
    sql_print_error("Warning: Recovering table: '%s'",table->path);
    check_opt.flags=
        (myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0)
      | (marked_crashed                             ? 0 : T_QUICK)
      | (myisam_recover_options & HA_RECOVER_FORCE  ? 0 : T_SAFE_REPAIR)
      | T_AUTO_REPAIR;
      ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
       (marked_crashed                             ? 0 : T_QUICK) |
       (myisam_recover_options & HA_RECOVER_FORCE  ? 0 : T_SAFE_REPAIR) |
       T_AUTO_REPAIR);
    if (repair(thd, &check_opt))
      error=1;
  }
+6 −5
Original line number Diff line number Diff line
@@ -4685,7 +4685,7 @@ join_read_prev_same(READ_RECORD *info)
		   tab->ref.key_length))
  {
    table->status=STATUS_NOT_FOUND;
    error= 1;
    error= -1;
  }
  return error;
}
@@ -7056,8 +7056,9 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
	item_list.push_back(new Item_null());
      if (tab->ref.key_parts)
      {
	item_list.push_back(new Item_string(table->key_info[tab->ref.key].name,strlen(table->key_info[tab->ref.key].name)));
	item_list.push_back(new Item_int((int) tab->ref.key_length));
	item_list.push_back(new Item_string(table->key_info[tab->ref.key].name,
					    strlen(table->key_info[tab->ref.key].name)));
	item_list.push_back(new Item_int((int32) tab->ref.key_length));
	for (store_key **ref=tab->ref.key_copy ; *ref ; ref++)
	{
	  if (tmp2.length())
@@ -7069,13 +7070,13 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
      else if (tab->type == JT_NEXT)
      {
	item_list.push_back(new Item_string(table->key_info[tab->index].name,strlen(table->key_info[tab->index].name)));
	item_list.push_back(new Item_int((int) table->key_info[tab->index].key_length));
	item_list.push_back(new Item_int((int32) table->key_info[tab->index].key_length));
	item_list.push_back(new Item_null());
      }
      else if (tab->select && tab->select->quick)
      {
	item_list.push_back(new Item_string(table->key_info[tab->select->quick->index].name,strlen(table->key_info[tab->select->quick->index].name)));
	item_list.push_back(new Item_int((int) tab->select->quick->max_used_key_length));
	item_list.push_back(new Item_int((int32) tab->select->quick->max_used_key_length));
	item_list.push_back(new Item_null());
      }
      else
+2 −1
Original line number Diff line number Diff line
@@ -126,8 +126,9 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
  }
  union_result->save_time_stamp=!describe;

  for (sl=lex->select=&lex->select_lex;sl;sl=lex->select=sl->next)
  for (sl= &lex->select_lex; sl; sl=sl->next)
  {
    lex->select=sl;
    thd->offset_limit=sl->offset_limit;
    thd->select_limit=sl->select_limit+sl->offset_limit;
    if (thd->select_limit < sl->select_limit)