2000-07-31 21:29:14 +02:00
|
|
|
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
2001-12-06 13:10:51 +01:00
|
|
|
|
2000-07-31 21:29:14 +02:00
|
|
|
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.
|
2001-12-06 13:10:51 +01:00
|
|
|
|
2000-07-31 21:29:14 +02:00
|
|
|
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.
|
2001-12-06 13:10:51 +01:00
|
|
|
|
2000-07-31 21:29:14 +02:00
|
|
|
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 */
|
|
|
|
|
2005-05-26 12:09:14 +02:00
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
2000-07-31 21:29:14 +02:00
|
|
|
#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) {}
|
2004-11-11 19:39:35 +01:00
|
|
|
double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; }
|
2000-07-31 21:29:14 +02:00
|
|
|
void fix_length_and_dec() { decimals=0; max_length=6; }
|
2005-11-20 19:47:07 +01:00
|
|
|
void print(String *str) { str->append(STRING_WITH_LEN("0.0")); }
|
2005-06-17 16:27:47 +02:00
|
|
|
const char *func_name() const { return "unique_users"; }
|
2000-07-31 21:29:14 +02:00
|
|
|
};
|
|
|
|
|
2002-10-02 12:33:08 +02:00
|
|
|
|
2000-07-31 21:29:14 +02:00
|
|
|
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) {}
|
2004-01-19 16:53:25 +01:00
|
|
|
Item_sum_unique_users(THD *thd, Item_sum_unique_users *item)
|
2003-01-30 17:07:39 +01:00
|
|
|
:Item_sum_num(thd, item) {}
|
2004-11-11 19:39:35 +01:00
|
|
|
double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; }
|
2000-07-31 21:29:14 +02:00
|
|
|
enum Sumfunctype sum_func () const {return UNIQUE_USERS_FUNC;}
|
2003-08-28 02:10:14 +02:00
|
|
|
void clear() {}
|
2000-07-31 21:29:14 +02:00
|
|
|
bool add() { return 0; }
|
|
|
|
void reset_field() {}
|
2003-08-20 15:25:44 +02:00
|
|
|
void update_field() {}
|
2005-07-01 06:05:42 +02:00
|
|
|
bool fix_fields(THD *thd, Item **ref)
|
2002-11-21 10:01:33 +01:00
|
|
|
{
|
2004-03-17 13:26:26 +01:00
|
|
|
DBUG_ASSERT(fixed == 0);
|
2002-11-21 10:01:33 +01:00
|
|
|
fixed= 1;
|
2004-10-20 03:04:37 +02:00
|
|
|
return FALSE;
|
2002-11-21 10:01:33 +01:00
|
|
|
}
|
2003-02-05 03:50:48 +01:00
|
|
|
Item *copy_or_same(THD* thd)
|
2003-01-30 17:07:39 +01:00
|
|
|
{
|
2004-01-19 16:53:25 +01:00
|
|
|
return new Item_sum_unique_users(thd, this);
|
2003-01-30 17:07:39 +01:00
|
|
|
}
|
2005-11-20 19:47:07 +01:00
|
|
|
void print(String *str) { str->append(STRING_WITH_LEN("0.0")); }
|
2005-02-08 23:50:45 +01:00
|
|
|
Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
|
2005-06-17 16:27:47 +02:00
|
|
|
const char *func_name() const { return "sum_unique_users"; }
|
2000-07-31 21:29:14 +02:00
|
|
|
};
|