List:Commits« Previous MessageNext Message »
From:marc.alff Date:December 21 2006 9:18pm
Subject:bk commit into 5.1 tree (malff:1.2361) BUG#22687
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marcsql. When marcsql does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-12-21 13:18:43-07:00, malff@weblab.(none) +11 -0
  Bug#22687 (Functions UNIQUE_USERS, GROUP_UNIQUE_USERS)
  
  The native functions UNIQUE_USERS and GROUP_UNIQUE_USERS are basically
  dead code:
  - they are not documented
  - they are not tested
  - they are not properly implemented (input arguments are not expressions)
  - they have no functional use (arguments are ignored, the result is always 0)
  - they pollute the parser, by making the two names reserved keywords
  
  This fix removes the implementation from the code base, to improve the
  general code health.

  BitKeeper/deleted/.del-item_uniq.cc@stripped, 2006-12-21 08:45:01-07:00, malff@weblab.(none)
+0 -0
    Delete: sql/item_uniq.cc

  BitKeeper/deleted/.del-item_uniq.h@stripped, 2006-12-21 08:44:56-07:00, malff@weblab.(none)
+0 -0
    Delete: sql/item_uniq.h

  libmysqld/Makefile.am@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +1 -1
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  mysql-test/r/parser.result@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +6 -6
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  mysql-test/t/parser.test@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +10 -6
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  sql/Makefile.am@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +2 -2
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  sql/item.h@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +0 -1
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  sql/item_sum.h@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +1 -1
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  sql/lex.h@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +0 -2
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  sql/mysql_priv.h@stripped, 2006-12-21 12:02:49-07:00, malff@weblab.(none) +1 -0
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

  sql/sql_yacc.yy@stripped, 2006-12-21 12:02:50-07:00, malff@weblab.(none) +0 -8
    Remove native functions UNIQUE_USERS() and GROUP_UNIQUE_USERS().

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	malff
# Host:	weblab.(none)
# Root:	/home/marcsql/TREE/mysql-5.1-22687

--- 1.167/sql/Makefile.am	2006-12-21 13:18:49 -07:00
+++ 1.168/sql/Makefile.am	2006-12-21 13:18:49 -07:00
@@ -43,7 +43,7 @@ mysqld_LDADD =		@MYSQLD_EXTRA_LDFLAGS@ \
 			$(LDADD)  $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
                         @yassl_libs@ @openssl_libs@
 noinst_HEADERS =	item.h item_func.h item_sum.h item_cmpfunc.h \
-			item_strfunc.h item_timefunc.h item_uniq.h \
+			item_strfunc.h item_timefunc.h \
 			item_xmlfunc.h \
 			item_create.h item_subselect.h item_row.h \
 			mysql_priv.h item_geofunc.h sql_bitmap.h \
@@ -83,7 +83,7 @@ mysqld_SOURCES =	sql_lex.cc sql_handler.
 			sql_base.cc table.cc sql_select.cc sql_insert.cc \
 			sql_prepare.cc sql_error.cc sql_locale.cc \
 			sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
-			procedure.cc item_uniq.cc sql_test.cc \
+			procedure.cc sql_test.cc \
 			log.cc log_event.cc init.cc derror.cc sql_acl.cc \
 			unireg.cc des_key_file.cc \
 			discover.cc time.cc opt_range.cc opt_sum.cc \

--- 1.216/sql/item.h	2006-12-21 13:18:49 -07:00
+++ 1.217/sql/item.h	2006-12-21 13:18:49 -07:00
@@ -2135,7 +2135,6 @@ public:
 #include "item_strfunc.h"
 #include "item_geofunc.h"
 #include "item_timefunc.h"
-#include "item_uniq.h"
 #include "item_subselect.h"
 #include "item_xmlfunc.h"
 #endif

--- 1.109/sql/item_sum.h	2006-12-21 13:18:49 -07:00
+++ 1.110/sql/item_sum.h	2006-12-21 13:18:49 -07:00
@@ -223,7 +223,7 @@ class Item_sum :public Item_result_field
 public:
   enum Sumfunctype
   { COUNT_FUNC, COUNT_DISTINCT_FUNC, SUM_FUNC, SUM_DISTINCT_FUNC, AVG_FUNC,
-    AVG_DISTINCT_FUNC, MIN_FUNC, MAX_FUNC, UNIQUE_USERS_FUNC, STD_FUNC,
+    AVG_DISTINCT_FUNC, MIN_FUNC, MAX_FUNC, STD_FUNC,
     VARIANCE_FUNC, SUM_BIT_FUNC, UDF_SUM_FUNC, GROUP_CONCAT_FUNC
   };
 

--- 1.166/sql/lex.h	2006-12-21 13:18:49 -07:00
+++ 1.167/sql/lex.h	2006-12-21 13:18:49 -07:00
@@ -593,7 +593,6 @@ static SYMBOL sql_functions[] = {
   { "DATE_SUB",		SYM(DATE_SUB_INTERVAL)},
   { "EXTRACT",		SYM(EXTRACT_SYM)},
   { "GROUP_CONCAT",	SYM(GROUP_CONCAT_SYM)},
-  { "GROUP_UNIQUE_USERS",	SYM(GROUP_UNIQUE_USERS)},
   { "MAX",		SYM(MAX_SYM)},
   { "MID",		SYM(SUBSTRING)},	/* unireg function */
   { "MIN",		SYM(MIN_SYM)},
@@ -611,7 +610,6 @@ static SYMBOL sql_functions[] = {
   { "SYSDATE",		SYM(SYSDATE)},
   { "SYSTEM_USER",      SYM(USER)},
   { "TRIM",		SYM(TRIM)},
-  { "UNIQUE_USERS",	SYM(UNIQUE_USERS)},
   { "VARIANCE",		SYM(VARIANCE_SYM)},
   { "VAR_POP",		SYM(VARIANCE_SYM)},
   { "VAR_SAMP",		SYM(VAR_SAMP_SYM)},

--- 1.464/sql/mysql_priv.h	2006-12-21 13:18:49 -07:00
+++ 1.465/sql/mysql_priv.h	2006-12-21 13:18:49 -07:00
@@ -36,6 +36,7 @@
 #include <signal.h>
 #include <thr_lock.h>
 #include <my_base.h>			/* Needed by field.h */
+#include <queues.h>
 #include "sql_bitmap.h"
 #include "sql_array.h"
 

--- 1.527/sql/sql_yacc.yy	2006-12-21 13:18:49 -07:00
+++ 1.528/sql/sql_yacc.yy	2006-12-21 13:18:49 -07:00
@@ -537,7 +537,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  GRANTS
 %token  GROUP                         /* SQL-2003-R */
 %token  GROUP_CONCAT_SYM
-%token  GROUP_UNIQUE_USERS
 %token  GT_SYM                        /* OPERATOR */
 %token  HANDLER_SYM
 %token  HASH_SYM
@@ -864,7 +863,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  UNINSTALL_SYM
 %token  UNION_SYM                     /* SQL-2003-R */
 %token  UNIQUE_SYM
-%token  UNIQUE_USERS
 %token  UNKNOWN_SYM                   /* SQL-2003-R */
 %token  UNLOCK_SYM
 %token  UNSIGNED
@@ -6279,10 +6277,6 @@ simple_expr:
             }
             $$= new (YYTHD->mem_root) Item_func_interval((Item_row *)$1);
           }
-	| UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' expr_list ')'
-	  {
-            $$= new Item_func_unique_users($3,atoi($5.str),atoi($7.str), * $9);
-	  }
         ;
 
 /*
@@ -6769,8 +6763,6 @@ sum_expr:
 	  { Select->in_sum_expr--; }
 	  ')'
 	  { $$=new Item_sum_count_distinct(* $5); }
-	| GROUP_UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' in_sum_expr ')'
-	  { $$= new Item_sum_unique_users($3,atoi($5.str),atoi($7.str),$9); }
 	| MIN_SYM '(' in_sum_expr ')'
 	  { $$=new Item_sum_min($3); }
 /*

--- 1.4/mysql-test/r/parser.result	2006-12-21 13:18:50 -07:00
+++ 1.5/mysql-test/r/parser.result	2006-12-21 13:18:50 -07:00
@@ -49,7 +49,7 @@ ERROR 42000: You have an error in your S
 create table GROUP_CONCAT (a int);
 drop table GROUP_CONCAT;
 create table GROUP_UNIQUE_USERS(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'GROUP_UNIQUE_USERS(a int)' at
line 1
+drop table GROUP_UNIQUE_USERS;
 create table GROUP_UNIQUE_USERS (a int);
 drop table GROUP_UNIQUE_USERS;
 create table MAX(a int);
@@ -121,7 +121,7 @@ ERROR 42000: You have an error in your S
 create table TRIM (a int);
 drop table TRIM;
 create table UNIQUE_USERS(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'UNIQUE_USERS(a int)' at line
1
+drop table UNIQUE_USERS;
 create table UNIQUE_USERS (a int);
 drop table UNIQUE_USERS;
 create table VARIANCE(a int);
@@ -186,9 +186,9 @@ ERROR 42000: You have an error in your S
 create table GROUP_CONCAT (a int);
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'GROUP_CONCAT (a int)' at line
1
 create table GROUP_UNIQUE_USERS(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'GROUP_UNIQUE_USERS(a int)' at
line 1
+drop table GROUP_UNIQUE_USERS;
 create table GROUP_UNIQUE_USERS (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'GROUP_UNIQUE_USERS (a int)'
at line 1
+drop table GROUP_UNIQUE_USERS;
 create table MAX(a int);
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1
 create table MAX (a int);
@@ -258,9 +258,9 @@ ERROR 42000: You have an error in your S
 create table TRIM (a int);
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'TRIM (a int)' at line 1
 create table UNIQUE_USERS(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'UNIQUE_USERS(a int)' at line
1
+drop table UNIQUE_USERS;
 create table UNIQUE_USERS (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'UNIQUE_USERS (a int)' at line
1
+drop table UNIQUE_USERS;
 create table VARIANCE(a int);
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1
 create table VARIANCE (a int);

--- 1.4/mysql-test/t/parser.test	2006-12-21 13:18:50 -07:00
+++ 1.5/mysql-test/t/parser.test	2006-12-21 13:18:50 -07:00
@@ -77,8 +77,9 @@ create table GROUP_CONCAT(a int);
 create table GROUP_CONCAT (a int);
 drop table GROUP_CONCAT;
 
---error ER_PARSE_ERROR
+# Limitation removed in 5.1
 create table GROUP_UNIQUE_USERS(a int);
+drop table GROUP_UNIQUE_USERS;
 create table GROUP_UNIQUE_USERS (a int);
 drop table GROUP_UNIQUE_USERS;
 
@@ -167,8 +168,9 @@ create table TRIM(a int);
 create table TRIM (a int);
 drop table TRIM;
 
---error ER_PARSE_ERROR
+# Limitation removed in 5.1
 create table UNIQUE_USERS(a int);
+drop table UNIQUE_USERS;
 create table UNIQUE_USERS (a int);
 drop table UNIQUE_USERS;
 
@@ -249,10 +251,11 @@ create table GROUP_CONCAT(a int);
 --error ER_PARSE_ERROR
 create table GROUP_CONCAT (a int);
 
---error ER_PARSE_ERROR
+# Limitation removed in 5.1
 create table GROUP_UNIQUE_USERS(a int);
---error ER_PARSE_ERROR
+drop table GROUP_UNIQUE_USERS;
 create table GROUP_UNIQUE_USERS (a int);
+drop table GROUP_UNIQUE_USERS;
 
 --error ER_PARSE_ERROR
 create table MAX(a int);
@@ -339,10 +342,11 @@ create table TRIM(a int);
 --error ER_PARSE_ERROR
 create table TRIM (a int);
 
---error ER_PARSE_ERROR
+# Limitation removed in 5.1
 create table UNIQUE_USERS(a int);
---error ER_PARSE_ERROR
+drop table UNIQUE_USERS;
 create table UNIQUE_USERS (a int);
+drop table UNIQUE_USERS;
 
 --error ER_PARSE_ERROR
 create table VARIANCE(a int);

--- 1.103/libmysqld/Makefile.am	2006-12-21 13:18:50 -07:00
+++ 1.104/libmysqld/Makefile.am	2006-12-21 13:18:50 -07:00
@@ -51,7 +51,7 @@ sqlsources = derror.cc field.cc field_co
 	hostname.cc init.cc password.c \
 	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
 	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
-	item_geofunc.cc item_uniq.cc item_subselect.cc item_row.cc\
+	item_geofunc.cc item_subselect.cc item_row.cc\
 	item_xmlfunc.cc \
 	key.cc lock.cc log.cc log_event.cc sql_state.c \
 	protocol.cc net_serv.cc opt_range.cc \
Thread
bk commit into 5.1 tree (malff:1.2361) BUG#22687marc.alff21 Dec