~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-updates

« back to all changes in this revision

Viewing changes to sql/sql_select.cc

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2015-06-13 21:09:48 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150613210948-tkboqdfc3y9ifptl
Tags: 5.5.44-1ubuntu0.14.10.1
* SECURITY UPDATE: Update to 5.5.44 to fix security issues (LP: #1464895):
  - CVE-2015-3152
* Upstream also includes lots of line ending changes (from CRLF -> LF)
* Removed hotfix patch now included in upstream release (MDEV-8115)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9013
9013
          if (!sel->quick_keys.is_subset(tab->checked_keys) ||
9014
9014
              !sel->needed_reg.is_subset(tab->checked_keys))
9015
9015
          {
 
9016
            /*
 
9017
              "Range checked for each record" is a "last resort" access method
 
9018
              that should only be used when the other option is a cross-product
 
9019
              join.
 
9020
 
 
9021
              We use the following condition (it's approximate):
 
9022
              1. There are potential keys for (sel->needed_reg)
 
9023
              2. There were no possible ways to construct a quick select, or
 
9024
                 the quick select would be more expensive than the full table
 
9025
                 scan.
 
9026
            */
9016
9027
            tab->use_quick= (!sel->needed_reg.is_clear_all() &&
9017
9028
                             (sel->quick_keys.is_clear_all() ||
9018
 
                              (sel->quick &&
9019
 
                               (sel->quick->records >= 100L)))) ?
 
9029
                              (sel->quick && 
 
9030
                               sel->quick->read_time > 
 
9031
                               tab->table->file->scan_time() + 
 
9032
                               tab->table->file->stats.records/TIME_FOR_COMPARE
 
9033
                               ))) ?
9020
9034
              2 : 1;
9021
9035
            sel->read_tables= used_tables & ~current_map;
9022
9036
            sel->quick_keys.clear_all();