Browse Source
Bug#22687 (Functions UNIQUE_USERS, GROUP_UNIQUE_USERS)
Bug#22687 (Functions UNIQUE_USERS, GROUP_UNIQUE_USERS)
According to some internal communication, these two functions are place holders for future enhancements. Because they use a variable number of parameters, the implementation defined a reserved keyword for them in the parser grammar. Unfortunately, doing so creates a bug similar to Bug 21114 reported for the function FORMAT. In the 5.1 code base, due to improvements in the code implemented with bug 21114, having a reserved keyword for functions with a variable number of arguments is not needed any more by the implementation. As a result, this fix removes the place-holder implementation, and removes the unnecessary reserved keywords. Should the functions UNIQUE_USERS and GROUP_UNIQUE_USERS be finally implemented in a later release, the implementation should sub class Create_native_func in sql/item_create.cc. For example, see the class Create_func_concat. BitKeeper/deleted/.del-item_uniq.cc: Rename: sql/item_uniq.cc -> BitKeeper/deleted/.del-item_uniq.cc BitKeeper/deleted/.del-item_uniq.h: Rename: sql/item_uniq.h -> BitKeeper/deleted/.del-item_uniq.h libmysqld/Makefile.am: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). mysql-test/r/parser.result: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). mysql-test/t/parser.test: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). sql/Makefile.am: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). sql/item.h: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). sql/item_sum.h: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). sql/lex.h: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). sql/mysql_priv.h: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS(). sql/sql_yacc.yy: Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().pull/374/head
11 changed files with 21 additions and 122 deletions
-
2libmysqld/Makefile.am
-
12mysql-test/r/parser.result
-
16mysql-test/t/parser.test
-
4sql/Makefile.am
-
1sql/item.h
-
2sql/item_sum.h
-
32sql/item_uniq.cc
-
63sql/item_uniq.h
-
2sql/lex.h
-
1sql/mysql_priv.h
-
8sql/sql_yacc.yy
@ -1,32 +0,0 @@ |
|||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
|||
|
|||
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 |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
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 */ |
|||
|
|||
/* Compability file */ |
|||
|
|||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|||
#pragma implementation // gcc: Class implementation
|
|||
#endif
|
|||
|
|||
#include "mysql_priv.h"
|
|||
|
|||
Field *Item_sum_unique_users::create_tmp_field(bool group, TABLE *table, |
|||
uint convert_blob_length) |
|||
{ |
|||
Field *field= new Field_long(9, maybe_null, name, 1); |
|||
if (field) |
|||
field->init(table); |
|||
return field; |
|||
} |
@ -1,63 +0,0 @@ |
|||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB |
|||
|
|||
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 |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
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 */ |
|||
|
|||
/* Compability file ; This file only contains dummy functions */ |
|||
|
|||
#ifdef USE_PRAGMA_INTERFACE |
|||
#pragma interface |
|||
#endif |
|||
|
|||
#include <queues.h> |
|||
|
|||
class Item_func_unique_users :public Item_real_func |
|||
{ |
|||
public: |
|||
Item_func_unique_users(Item *name_arg,int start,int end,List<Item> &list) |
|||
:Item_real_func(list) {} |
|||
double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; } |
|||
void fix_length_and_dec() { decimals=0; max_length=6; } |
|||
void print(String *str) { str->append(STRING_WITH_LEN("0.0")); } |
|||
const char *func_name() const { return "unique_users"; } |
|||
}; |
|||
|
|||
|
|||
class Item_sum_unique_users :public Item_sum_num |
|||
{ |
|||
public: |
|||
Item_sum_unique_users(Item *name_arg,int start,int end,Item *item_arg) |
|||
:Item_sum_num(item_arg) {} |
|||
Item_sum_unique_users(THD *thd, Item_sum_unique_users *item) |
|||
:Item_sum_num(thd, item) {} |
|||
double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; } |
|||
enum Sumfunctype sum_func () const {return UNIQUE_USERS_FUNC;} |
|||
void clear() {} |
|||
bool add() { return 0; } |
|||
void reset_field() {} |
|||
void update_field() {} |
|||
bool fix_fields(THD *thd, Item **ref) |
|||
{ |
|||
DBUG_ASSERT(fixed == 0); |
|||
fixed= 1; |
|||
return FALSE; |
|||
} |
|||
Item *copy_or_same(THD* thd) |
|||
{ |
|||
return new Item_sum_unique_users(thd, this); |
|||
} |
|||
void print(String *str) { str->append(STRING_WITH_LEN("0.0")); } |
|||
Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length); |
|||
const char *func_name() const { return "sum_unique_users"; } |
|||
}; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue