List:Commits« Previous MessageNext Message »
From:Patrick Galbraith Date:January 6 2006 4:07pm
Subject:bk commit into 5.1 tree (patg:1.2021)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of patg. When patg 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
  1.2021 06/01/06 08:07:12 patg@stripped +3 -0
  ha_partition.cc:
    WL# 2682
    More work, changed do {} while loop to not use index variable
  partition_select.test:
    WL# 2682
    More test cases
  partition_select.result:
    WL #2682
    More test results

  sql/ha_partition.cc
    1.27 06/01/06 08:06:09 patg@stripped +4 -5
    WL# 2682
    
    More work, changed do {} while loop to not use index variable

  mysql-test/t/partition_select.test
    1.2 06/01/06 08:06:04 patg@stripped +77 -0
    WL# 2682
    
    More test cases

  mysql-test/r/partition_select.result
    1.2 06/01/06 08:06:02 patg@stripped +70 -0
    WL #2682
    
    More test results

# 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:	patg
# Host:	govinda.site
# Root:	/home/patg/mysql-build/mysql-5.1-wl2682

--- 1.26/sql/ha_partition.cc	2006-01-03 18:11:50 -08:00
+++ 1.27/sql/ha_partition.cc	2006-01-06 08:06:09 -08:00
@@ -1557,7 +1557,7 @@
 
   DBUG_PRINT("info", ("rnd_init on partition %d", current_partition_index));
 
-  for (i= current_partition_index; i < m_part_info->no_parts; i++)
+  for (i= current_partition_index; i < m_tot_parts; i++)
   {
     if (_bitmap_is_set(&(m_part_info->used_partitions), i))
       if ((error= m_file[i]->ha_rnd_init(scan)))
@@ -3135,17 +3135,16 @@
 
 ha_rows ha_partition::estimate_rows_upper_bound()
 {
-  handler **file;
   ha_rows rows, tot_rows= 0;
+  handler **file;
   DBUG_ENTER("ha_partition::estimate_rows_upper_bound");
 
+  file= m_file;
   do
   {
-    int i= file - m_file;
-    if (_bitmap_is_set(&(m_part_info->used_partitions), i))
+    if (_bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
     {
       rows= (*file)->estimate_rows_upper_bound();
-
       if (rows == HA_POS_ERROR)
         DBUG_RETURN(HA_POS_ERROR);
       tot_rows+= rows;

--- 1.1/mysql-test/r/partition_select.result	2005-12-31 15:28:06 -08:00
+++ 1.2/mysql-test/r/partition_select.result	2006-01-06 08:06:02 -08:00
@@ -125,8 +125,78 @@
 18
 19
 20
+SELECT * FROM t2 PARTITION (p3) ORDER BY id;
+id
+17
+18
+19
+20
 SELECT * FROM t2 PARTITION (p3) WHERE id = 2;
 id
 2
 SELECT * FROM t2 PARTITION (foo);
 ERROR HY000: partition 'foo' doesn't exist
+DROP TABLE IF EXISTS `t3`;
+Warnings:
+Note	1051	Unknown table 't3'
+CREATE TABLE `t3` (
+`id` int(32) default NULL,
+`name` varchar(32) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 
+PARTITION BY LIST (id) (
+PARTITION p0 VALUES IN (1,3,5,7),
+PARTITION p1 VALUES IN (0,2,4,6,8),
+PARTITION p2 VALUES IN (9,10,11,12,13)
+);
+INSERT INTO `t3` VALUES (1,'first'), (3,'third'),(5,'fifth'),(7,'seventh'),(0,'zilch'),(2,'second'),(4,'fourth'),(6,'sixth'),(8,'eighth'),(9,'ninth'),(10,'tenth'),(11,'eleventh'),(12,'twelfth'),(13,'thirteenth');
+SELECT * FROM `t3`;
+id	name
+1	first
+3	third
+5	fifth
+7	seventh
+0	zilch
+2	second
+4	fourth
+6	sixth
+8	eighth
+9	ninth
+10	tenth
+11	eleventh
+12	twelfth
+13	thirteenth
+SELECT * FROM `t3` PARTITION (p0);
+id	name
+1	first
+3	third
+5	fifth
+7	seventh
+SELECT * FROM `t3` PARTITION (p1);
+id	name
+0	zilch
+2	second
+4	fourth
+6	sixth
+8	eighth
+SELECT * FROM `t3` PARTITION (p2);
+id	name
+9	ninth
+10	tenth
+11	eleventh
+12	twelfth
+13	thirteenth
+SELECT * FROM `t3` PARTITION (p2) ORDER BY id;
+id	name
+9	ninth
+10	tenth
+11	eleventh
+12	twelfth
+13	thirteenth
+DROP TABLE IF EXISTS `t4`;
+Warnings:
+Note	1051	Unknown table 't4'
+CREATE TABLE `t4` (
+`id` int(32) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
+INSERT INTO `t4` SELECT * FROM `t2`;
+INSERT INTO `t4` SELECT * FROM `t2` ORDER BY id;

--- 1.1/mysql-test/t/partition_select.test	2005-12-31 15:28:06 -08:00
+++ 1.2/mysql-test/t/partition_select.test	2006-01-06 08:06:04 -08:00
@@ -48,6 +48,83 @@
 SELECT * FROM t2 PARTITION (p1);
 SELECT * FROM t2 PARTITION (p2);
 SELECT * FROM t2 PARTITION (p3);
+SELECT * FROM t2 PARTITION (p3) ORDER BY id;
 SELECT * FROM t2 PARTITION (p3) WHERE id = 2;
 --error 1501
 SELECT * FROM t2 PARTITION (foo);
+
+
+DROP TABLE IF EXISTS `t3`;
+CREATE TABLE `t3` (
+  `id` int(32) default NULL,
+  `name` varchar(32) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 
+PARTITION BY LIST (id) (
+  PARTITION p0 VALUES IN (1,3,5,7),
+  PARTITION p1 VALUES IN (0,2,4,6,8),
+  PARTITION p2 VALUES IN (9,10,11,12,13)
+);
+
+INSERT INTO `t3` VALUES (1,'first'), (3,'third'),(5,'fifth'),(7,'seventh'),(0,'zilch'),(2,'second'),(4,'fourth'),(6,'sixth'),(8,'eighth'),(9,'ninth'),(10,'tenth'),(11,'eleventh'),(12,'twelfth'),(13,'thirteenth');
+
+SELECT * FROM `t3`;
+SELECT * FROM `t3` PARTITION (p0);
+SELECT * FROM `t3` PARTITION (p1);
+SELECT * FROM `t3` PARTITION (p2);
+SELECT * FROM `t3` PARTITION (p2) ORDER BY id;
+
+DROP TABLE IF EXISTS `t4`;
+CREATE TABLE `t4` (
+  `id` int(32) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
+
+INSERT INTO `t4` SELECT * FROM `t2`;
+INSERT INTO `t4` SELECT * FROM `t2` ORDER BY id;
+# not sure how to do this, since names could be anything
+#SELECT * FROM `t4` PARTITION (p0);
+#SELECT * FROM `t4` PARTITION (p1);
+#SELECT * FROM `t4` PARTITION (p2);
+#SELECT * FROM `t4` PARTITION (p3);
+#SELECT * FROM `t4` PARTITION (p3) ORDER BY id;
+
+CREATE TABLE `t5` (
+  id int(32),
+  name varchar(64),
+  purchased date)
+PARTITION BY RANGE( YEAR(purchased) )
+    SUBPARTITION BY HASH( TO_DAYS(purchased) ) (
+        PARTITION p0 VALUES LESS THAN (1990) (
+            SUBPARTITION s0,
+            SUBPARTITION s1
+        ),
+        PARTITION p1 VALUES LESS THAN (2000) (
+            SUBPARTITION s2,
+            SUBPARTITION s3
+        ),
+        PARTITION p2 VALUES LESS THAN MAXVALUE (
+            SUBPARTITION s4,
+            SUBPARTITION s5
+        )
+    );
+
+INSERT INTO `t5` VALUES (1, 'aaaaaaa', '2006-01-05 00:00:00');
+INSERT INTO `t5` VALUES (2, 'bbbbbbb', '2005-08-05 00:00:00');
+INSERT INTO `t5` VALUES (3, 'ccccccc', '1985-08-07 00:00:00');
+INSERT INTO `t5` VALUES (4, 'ddddddd', '2000-01-01 00:00:00');
+INSERT INTO `t5` VALUES (5, 'eeeeeee', '1999-12-01 00:00:00');
+INSERT INTO `t5` VALUES (6, 'fffffff', '2003-11-12 00:00:00');
+INSERT INTO `t5` VALUES (7, 'ggggggg', '1990-01-05 00:00:00');
+INSERT INTO `t5` VALUES (8, 'hhhhhhh', '1978-01-05 00:00:00');
+INSERT INTO `t5` VALUES (9, 'iiiiiii', '1979-01-05 00:00:00');
+INSERT INTO `t5` VALUES (10, 'jjjjjjj', '1992-01-05 00:00:00');
+INSERT INTO `t5` VALUES (11, 'kkkkkkk', '1993-01-05 00:00:00');
+INSERT INTO `t5` VALUES (12, 'mmmmmmm', '1994-01-05 00:00:00');
+INSERT INTO `t5` VALUES (13, 'nnnnnnn', '1989-01-05 00:00:00');
+INSERT INTO `t5` VALUES (14, 'ooooooo', '1983-12-05 00:00:00');
+INSERT INTO `t5` VALUES (15, 'ppppppp', '1986-06-05 00:00:00');
+INSERT INTO `t5` VALUES (16, 'qqqqqqq', '1974-04-11 00:00:00');
+INSERT INTO `t5` VALUES (17, 'qqqqqqq', '1960-03-15 00:00:00');
+INSERT INTO `t5` VALUES (18, 'sssssss', '1950-09-23 00:00:00');
+INSERT INTO `t5` VALUES (19, 'ttttttt', '1999-08-02 00:00:00');
+INSERT INTO `t5` VALUES (20, 'uuuuuuu', '1994-05-28 00:00:00');
+
Thread
bk commit into 5.1 tree (patg:1.2021)Patrick Galbraith6 Jan