~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to sql/multi_range_read.cc

  • Committer: Package Import Robot
  • Author(s): James Page, Otto Kekäläinen
  • Date: 2014-02-17 16:51:52 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140217165152-k315d3175g865kkx
Tags: 5.5.35-1
[ Otto Kekäläinen ]
* New upstream release, fixing the following security issues:
  - Buffer overflow in client/mysql.cc (Closes: #737597).
    - CVE-2014-0001
  - http://www.oracle.com/technetwork/topics/security/cpujan2014-1972949.html
    - CVE-2013-5891
    - CVE-2013-5908
    - CVE-2014-0386
    - CVE-2014-0393
    - CVE-2014-0401
    - CVE-2014-0402
    - CVE-2014-0412
    - CVE-2014-0420
    - CVE-2014-0437
* Upstream https://mariadb.atlassian.net/browse/MDEV-4902
  fixes compatibility with Bison 3.0 (Closes: #733002)
* Updated Russian debconf translation (Closes: #734426)
* Updated Japanese debconf translation (Closes: #735284)
* Updated French debconf translation (Closes: #736480)
* Renamed SONAME properly (Closes: #732967)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1494
1494
  @retval FALSE  No
1495
1495
*/
1496
1496
 
1497
 
bool key_uses_partial_cols(TABLE *table, uint keyno)
 
1497
bool key_uses_partial_cols(TABLE_SHARE *share, uint keyno)
1498
1498
{
1499
 
  KEY_PART_INFO *kp= table->key_info[keyno].key_part;
1500
 
  KEY_PART_INFO *kp_end= kp + table->key_info[keyno].key_parts;
 
1499
  KEY_PART_INFO *kp= share->key_info[keyno].key_part;
 
1500
  KEY_PART_INFO *kp_end= kp + share->key_info[keyno].key_parts;
1501
1501
  for (; kp != kp_end; kp++)
1502
1502
  {
1503
1503
    if (!kp->field->part_of_key.is_set(keyno))
1518
1518
  @retval FALSE  Otherwise
1519
1519
*/
1520
1520
 
1521
 
bool DsMrr_impl::check_cpk_scan(THD *thd, uint keyno, uint mrr_flags)
 
1521
bool DsMrr_impl::check_cpk_scan(THD *thd, TABLE_SHARE *share, uint keyno, 
 
1522
                                uint mrr_flags)
1522
1523
{
1523
1524
  return test((mrr_flags & HA_MRR_SINGLE_POINT) &&
1524
 
              keyno == table->s->primary_key && 
 
1525
              keyno == share->primary_key && 
1525
1526
              primary_file->primary_key_is_clustered() && 
1526
1527
              optimizer_flag(thd, OPTIMIZER_SWITCH_MRR_SORT_KEYS));
1527
1528
}
1557
1558
  COST_VECT dsmrr_cost;
1558
1559
  bool res;
1559
1560
  THD *thd= current_thd;
 
1561
  TABLE_SHARE *share= primary_file->get_table_share();
1560
1562
 
1561
 
  bool doing_cpk_scan= check_cpk_scan(thd, keyno, *flags); 
1562
 
  bool using_cpk= test(keyno == table->s->primary_key &&
 
1563
  bool doing_cpk_scan= check_cpk_scan(thd, share, keyno, *flags); 
 
1564
  bool using_cpk= test(keyno == share->primary_key &&
1563
1565
                       primary_file->primary_key_is_clustered());
1564
1566
  *flags &= ~HA_MRR_IMPLEMENTATION_FLAGS;
1565
1567
  if (!optimizer_flag(thd, OPTIMIZER_SWITCH_MRR) ||
1566
1568
      *flags & HA_MRR_INDEX_ONLY ||
1567
 
      (using_cpk && !doing_cpk_scan) || key_uses_partial_cols(table, keyno))
 
1569
      (using_cpk && !doing_cpk_scan) || key_uses_partial_cols(share, keyno))
1568
1570
  {
1569
1571
    /* Use the default implementation */
1570
1572
    *flags |= HA_MRR_USE_DEFAULT_IMPL;
1572
1574
    return TRUE;
1573
1575
  }
1574
1576
 
1575
 
  uint add_len= table->key_info[keyno].key_length + primary_file->ref_length; 
 
1577
  uint add_len= share->key_info[keyno].key_length + primary_file->ref_length; 
1576
1578
  *bufsz -= add_len;
1577
1579
  if (get_disk_sweep_mrr_cost(keyno, rows, *flags, bufsz, &dsmrr_cost))
1578
1580
    return TRUE;