~ubuntu-branches/ubuntu/utopic/mysql-5.5/utopic

« back to all changes in this revision

Viewing changes to sql/item_subselect.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-10-24 13:02:18 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20131024130218-kmsafm2gr2fza5k6
Tags: 5.5.34-0ubuntu1
* SECURITY UPDATE: Update to 5.5.34 to fix security issues (LP: #1243253)
  - http://www.oracle.com/technetwork/topics/security/cpuoct2013-1899837.html
  - CVE-2013-3839
  - CVE-2013-5807

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
 
1
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
1065
1065
      if (upper_item)
1066
1066
        upper_item->set_sub_test(item);
1067
1067
    }
1068
 
    /* fix fields is already called for  left expression */
1069
 
    substitution= func->create(left_expr, subs);
 
1068
    /*
 
1069
      fix fields is already called for  left expression.
 
1070
      Note that real_item() should be used instead of
 
1071
      original left expression because left_expr can be
 
1072
      runtime created Ref item which is deleted at the end
 
1073
      of the statement. Thus one of 'substitution' arguments
 
1074
      can be broken in case of PS.
 
1075
    */ 
 
1076
    substitution= func->create(left_expr->real_item(), subs);
1070
1077
    DBUG_RETURN(RES_OK);
1071
1078
  }
1072
1079
 
1087
1094
    }
1088
1095
    thd->lex->current_select= current;
1089
1096
 
 
1097
    /* We will refer to upper level cache array => we have to save it for SP */
 
1098
    optimizer->keep_top_level_cache();
 
1099
 
1090
1100
    /*
1091
1101
      As far as  Item_ref_in_optimizer do not substitute itself on fix_fields
1092
1102
      we can use same item for all selects.
1261
1271
        // select and is not outer anymore.
1262
1272
        item->walk(&Item::remove_dependence_processor, 0,
1263
1273
                           (uchar *) select_lex->outer_select());
1264
 
        item= func->create(left_expr, item);
1265
 
        // fix_field of item will be done in time of substituting
 
1274
        item= func->create(left_expr->real_item(), item);
 
1275
        /*
 
1276
          fix_field of substitution item will be done in time of
 
1277
          substituting.
 
1278
          Note that real_item() should be used instead of
 
1279
          original left expression because left_expr can be
 
1280
          runtime created Ref item which is deleted at the end
 
1281
          of the statement. Thus one of 'substitution' arguments
 
1282
          can be broken in case of PS.
 
1283
        */ 
1266
1284
        substitution= item;
1267
1285
        have_to_be_excluded= 1;
1268
1286
        if (thd->lex->describe)