1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Fixed bug in GROUP BY ... DESC

Docs/manual.texi:
  Changelog
libmysql/libmysql.c:
  Fixed bug with mysql_use_result() when mysql_query() is called before mysql_free_result().
mysql-test/r/group_by.result:
  New tests
mysql-test/t/group_by.test:
  New tests
sql/stacktrace.c:
  Fix for SCO
This commit is contained in:
unknown
2001-12-10 17:51:07 +02:00
parent 6f8f45e959
commit 2d1e16eb04
7 changed files with 68 additions and 14 deletions

View File

@@ -140,7 +140,7 @@ typedef struct st_lex {
enum lex_states next_state;
enum enum_duplicates duplicates;
enum enum_tx_isolation tx_isolation;
uint in_sum_expr,grant,grant_tot_col,which_columns, sort_default;
uint in_sum_expr,grant,grant_tot_col,which_columns;
thr_lock_type lock_option;
bool create_refs,drop_primary,drop_if_exists,local_file;
bool in_comment,ignore_space,verbose;

View File

@@ -470,7 +470,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
ULONGLONG_NUM
%type <item>
literal text_literal insert_ident group_ident order_ident
literal text_literal insert_ident order_ident
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
using_list
@@ -1869,10 +1869,10 @@ group_clause:
| GROUP BY group_list
group_list:
group_list ',' group_ident
{ if (add_group_to_list($3,(bool) 1)) YYABORT; }
| group_ident
{ if (add_group_to_list($1,(bool) 1)) YYABORT; }
group_list ',' order_ident order_dir
{ if (add_group_to_list($3,(bool) $4)) YYABORT; }
| order_ident order_dir
{ if (add_group_to_list($1,(bool) $2)) YYABORT; }
/*
** Order by statement in select
@@ -1883,7 +1883,7 @@ opt_order_clause:
| order_clause
order_clause:
ORDER_SYM BY { Lex->sort_default=1; } order_list
ORDER_SYM BY order_list
order_list:
order_list ',' order_ident order_dir
@@ -1893,8 +1893,8 @@ order_list:
order_dir:
/* empty */ { $$ = 1; }
| ASC { $$ = Lex->sort_default=1; }
| DESC { $$ = Lex->sort_default=0; }
| ASC { $$ =1; }
| DESC { $$ =0; }
limit_clause:
@@ -2452,9 +2452,6 @@ table_wild:
| ident '.' ident '.' '*'
{ $$ = new Item_field((current_thd->client_capabilities & CLIENT_NO_SCHEMA ? NullS : $1.str),$3.str,"*"); }
group_ident:
order_ident order_dir
order_ident:
expr { $$=$1; }

View File

@@ -218,7 +218,7 @@ void write_core(int sig)
{
signal(sig, SIG_DFL);
pthread_kill(pthread_self(), sig);
#if defined(P_MYID)
#if defined(P_MYID) && !defined(SCO)
/* On Solaris, the above kill is not enough */
sigsend(P_PID,P_MYID,sig);
#endif