Loading include/my_sys.h +5 −1 Original line number Diff line number Diff line Loading @@ -108,6 +108,10 @@ extern int NEAR my_errno; /* Last error in mysys */ /* root_alloc flags */ #define MY_KEEP_PREALLOC 1 #define MY_MARK_BLOCKS_FREE 2 /* do not my_free() blocks, just move used into free list and mark all blocks as fully free */ /* defines when allocating data */ Loading include/my_tree.h +3 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,9 @@ void init_tree(TREE *tree,uint default_alloc_size, int element_size, qsort_cmp2 compare, my_bool with_delete, void (*free_element)(void*)); void delete_tree(TREE*); void reset_tree(TREE*); /* similar to delete tree, except we do not my_free() blocks in mem_root */ #define is_tree_inited(tree) ((tree)->root != 0) /* Functions on leafs */ Loading mysql-test/mysql-test-run.sh +1 −1 Original line number Diff line number Diff line Loading @@ -463,7 +463,7 @@ start_master() --core \ --tmpdir=$MYSQL_TMP_DIR \ --language=english \ --innobase_data_file_path=ibdata1:50M \ --innodb_data_file_path=ibdata1:50M \ $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" fi Loading mysql-test/r/count_distinct2.result 0 → 100644 +76 −0 Original line number Diff line number Diff line n1 1 2 NULL count(distinct n1) 2 n2 11 12 13 NULL count(distinct n2) 3 s one two NULL count(distinct s) 2 vs eleven twevle thirteen NULL count(distinct vs) 3 t eleven twelve foo bar NULL count(distinct t) 4 n1 n2 1 11 2 11 2 12 2 13 NULL 13 2 NULL count(distinct n1,n2) 4 n1 s 1 one 2 two NULL two 2 NULL count(distinct n1,s) 2 s n1 vs one 1 eleven two 2 eleven two 2 twevle two 2 thirteen two NULL thirteen NULL 2 thirteen two 2 NULL count(distinct s,n1,vs) 4 s t one eleven two eleven two twelve two foo two bar NULL bar two NULL count(distinct s,t) 5 count(distinct n1) count(distinct n2) 2 3 count(distinct n2) n1 1 NULL 1 1 3 2 mysql-test/t/count_distinct2.test 0 → 100644 +45 −0 Original line number Diff line number Diff line create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text); insert into t1 values (1,11, 'one','eleven', 'eleven'), (1,11, 'one','eleven', 'eleven'), (2,11, 'two','eleven', 'eleven'), (2,12, 'two','twevle', 'twelve'), (2,13, 'two','thirteen', 'foo'), (2,13, 'two','thirteen', 'foo'), (2,13, 'two','thirteen', 'bar'), (NULL,13, 'two','thirteen', 'bar'), (2,NULL, 'two','thirteen', 'bar'), (2,13, NULL,'thirteen', 'bar'), (2,13, 'two',NULL, 'bar'), (2,13, 'two','thirteen', NULL); select distinct n1 from t1; select count(distinct n1) from t1; select distinct n2 from t1; select count(distinct n2) from t1; select distinct s from t1; select count(distinct s) from t1; select distinct vs from t1; select count(distinct vs) from t1; select distinct t from t1; select count(distinct t) from t1; select distinct n1,n2 from t1; select count(distinct n1,n2) from t1; select distinct n1,s from t1; select count(distinct n1,s) from t1; select distinct s,n1,vs from t1; select count(distinct s,n1,vs) from t1; select distinct s,t from t1; select count(distinct s,t) from t1; select count(distinct n1), count(distinct n2) from t1; select count(distinct n2), n1 from t1 group by n1; drop table t1; Loading
include/my_sys.h +5 −1 Original line number Diff line number Diff line Loading @@ -108,6 +108,10 @@ extern int NEAR my_errno; /* Last error in mysys */ /* root_alloc flags */ #define MY_KEEP_PREALLOC 1 #define MY_MARK_BLOCKS_FREE 2 /* do not my_free() blocks, just move used into free list and mark all blocks as fully free */ /* defines when allocating data */ Loading
include/my_tree.h +3 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,9 @@ void init_tree(TREE *tree,uint default_alloc_size, int element_size, qsort_cmp2 compare, my_bool with_delete, void (*free_element)(void*)); void delete_tree(TREE*); void reset_tree(TREE*); /* similar to delete tree, except we do not my_free() blocks in mem_root */ #define is_tree_inited(tree) ((tree)->root != 0) /* Functions on leafs */ Loading
mysql-test/mysql-test-run.sh +1 −1 Original line number Diff line number Diff line Loading @@ -463,7 +463,7 @@ start_master() --core \ --tmpdir=$MYSQL_TMP_DIR \ --language=english \ --innobase_data_file_path=ibdata1:50M \ --innodb_data_file_path=ibdata1:50M \ $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" fi Loading
mysql-test/r/count_distinct2.result 0 → 100644 +76 −0 Original line number Diff line number Diff line n1 1 2 NULL count(distinct n1) 2 n2 11 12 13 NULL count(distinct n2) 3 s one two NULL count(distinct s) 2 vs eleven twevle thirteen NULL count(distinct vs) 3 t eleven twelve foo bar NULL count(distinct t) 4 n1 n2 1 11 2 11 2 12 2 13 NULL 13 2 NULL count(distinct n1,n2) 4 n1 s 1 one 2 two NULL two 2 NULL count(distinct n1,s) 2 s n1 vs one 1 eleven two 2 eleven two 2 twevle two 2 thirteen two NULL thirteen NULL 2 thirteen two 2 NULL count(distinct s,n1,vs) 4 s t one eleven two eleven two twelve two foo two bar NULL bar two NULL count(distinct s,t) 5 count(distinct n1) count(distinct n2) 2 3 count(distinct n2) n1 1 NULL 1 1 3 2
mysql-test/t/count_distinct2.test 0 → 100644 +45 −0 Original line number Diff line number Diff line create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text); insert into t1 values (1,11, 'one','eleven', 'eleven'), (1,11, 'one','eleven', 'eleven'), (2,11, 'two','eleven', 'eleven'), (2,12, 'two','twevle', 'twelve'), (2,13, 'two','thirteen', 'foo'), (2,13, 'two','thirteen', 'foo'), (2,13, 'two','thirteen', 'bar'), (NULL,13, 'two','thirteen', 'bar'), (2,NULL, 'two','thirteen', 'bar'), (2,13, NULL,'thirteen', 'bar'), (2,13, 'two',NULL, 'bar'), (2,13, 'two','thirteen', NULL); select distinct n1 from t1; select count(distinct n1) from t1; select distinct n2 from t1; select count(distinct n2) from t1; select distinct s from t1; select count(distinct s) from t1; select distinct vs from t1; select count(distinct vs) from t1; select distinct t from t1; select count(distinct t) from t1; select distinct n1,n2 from t1; select count(distinct n1,n2) from t1; select distinct n1,s from t1; select count(distinct n1,s) from t1; select distinct s,n1,vs from t1; select count(distinct s,n1,vs) from t1; select distinct s,t from t1; select count(distinct s,t) from t1; select count(distinct n1), count(distinct n2) from t1; select count(distinct n2), n1 from t1 group by n1; drop table t1;