title: how does MySQL RANGE COLUMNS partitioning work
body: <p>I've prepared a small test table to ask this question:</p>
  
  <pre><code>CREATE TABLE `part_two_cols` (
    `period_type_id` int(11) unsigned NOT NULL,
    `geolocation_id` tinyint(4) unsigned NOT NULL,
    m1 int default 0, 
    m2 int default 0,
    m3 int default 0,
    PRIMARY KEY (`period_type_id`,`geolocation_id`),
    KEY `fk_data_basic_group_id` (`geolocation_id`),
    KEY `fk_data_basic_period_type_id` (`period_type_id`)
  );
  </code></pre>
  
  <p>I want to have a double-column partitioning key (the same columns as in primary key). Each of those columns is an enum which can have 3 different values: 1,2,3. So all possible values are as follows:</p>
  
  <pre><code>INSERT INTO `part_two_cols` (period_type_id, geolocation_id)
  VALUES (1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3);
  </code></pre>
  
  <p>Now I have 9 records. And I want to prepare such partitions, that each records goes into separate partition. I have been trying the following:</p>
  
  <pre><code>ALTER TABLE `part_two_cols`
  PARTITION BY RANGE COLUMNS(period_type_id, geolocation_id) (
      PARTITION p0 VALUES LESS THAN (2, 2),
      PARTITION p1 VALUES LESS THAN (2, 3),
      PARTITION p2 VALUES LESS THAN (2, 4),
      PARTITION p3 VALUES LESS THAN (3, 2),
      PARTITION p4 VALUES LESS THAN (3, 3),
      PARTITION p5 VALUES LESS THAN (3, 4),
      PARTITION p6 VALUES LESS THAN (4, 2),
      PARTITION p7 VALUES LESS THAN (4, 3),
      PARTITION p8 VALUES LESS THAN (4, 4),
      PARTITION p9 VALUES LESS THAN (MAXVALUE, MAXVALUE)
  );
  </code></pre>
  
  <p>and I failed, because when testing EXPLAIN PARTITIONS, the result is not what I expect:</p>
  
  <pre><code>EXPLAIN PARTITIONS SELECT * FROM `part_two_cols` WHERE period_type_id=1|2|3 AND geolocation_id = 1|2|3;
  </code></pre>
  
  <p>The results I got are stored in following table:</p>
  
  <pre><code> pt | geo | part
  ----+-----+------
   1  |  1  |  p0
   1  |  2  |  p0
   1  |  3  |  p0
   2  |  1  |  p0
   2  |  2  |  p1
   2  |  3  |  p2
   3  |  1  |  p3
   3  |  2  |  p4
   3  |  3  |  p5
  </code></pre>
  
  <p>I wonder why do all pt=1 records fall into partition p0 - that is (1,1), (1,2) and (1,3)? I did a check on a single-column RANGE COLUMNS and I found out that <code>LESS THAN</code> is in fact LESS (and not less or equal, which was my first idea to analyse).</p>
  
  <p>The question is: what to change in above code to make each record fall into a separate partition. And what is the explanation.</p>