~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/subselect.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-27 14:23:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2350.
  • Revision ID: olafvdspek@gmail.com-20110627142335-38y17d8xxczy6ilm
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1238
1238
      {
1239
1239
        having= new Item_is_not_null_test(this, having);
1240
1240
        if (left_expr->maybe_null)
1241
 
        {
1242
 
          if (!(having= new Item_func_trig_cond(having,
1243
 
                                                get_cond_guard(0))))
1244
 
            return(RES_ERROR);
1245
 
        }
 
1241
          having= new Item_func_trig_cond(having, get_cond_guard(0));
1246
1242
        /*
1247
1243
          Item_is_not_null_test can't be changed during fix_fields()
1248
1244
          we can assign select_lex->having here, and pass 0 as last
1268
1264
        result is NULL or false, wrap condition in a trig_cond.
1269
1265
      */
1270
1266
      if (!abort_on_null && left_expr->maybe_null)
1271
 
      {
1272
 
        if (!(item= new Item_func_trig_cond(item, get_cond_guard(0))))
1273
 
          return(RES_ERROR);
1274
 
      }
 
1267
        item= new Item_func_trig_cond(item, get_cond_guard(0));
1275
1268
      /*
1276
1269
        TODO: figure out why the following is done here in
1277
1270
        single_value_transformer but there is no corresponding action in
1310
1303
                                            (char *)"<no matter>",
1311
1304
                                            (char *)"<result>"));
1312
1305
        if (!abort_on_null && left_expr->maybe_null)
1313
 
        {
1314
 
          if (!(new_having= new Item_func_trig_cond(new_having,
1315
 
                                                    get_cond_guard(0))))
1316
 
            return(RES_ERROR);
1317
 
        }
 
1306
          new_having= new Item_func_trig_cond(new_having, get_cond_guard(0));
1318
1307
        new_having->name= (char*)in_having_cond;
1319
1308
        select_lex->having= join->having= new_having;
1320
1309
        select_lex->having_fix_field= 1;
1484
1473
                            );
1485
1474
      Item *col_item= new Item_cond_or(item_eq, item_isnull);
1486
1475
      if (!abort_on_null && left_expr->element_index(i)->maybe_null)
1487
 
      {
1488
 
        if (!(col_item= new Item_func_trig_cond(col_item, get_cond_guard(i))))
1489
 
          return(RES_ERROR);
1490
 
      }
 
1476
        col_item= new Item_func_trig_cond(col_item, get_cond_guard(i));
1491
1477
      having_item= and_items(having_item, col_item);
1492
1478
 
1493
1479
      Item *item_nnull_test=
1579
1565
        */
1580
1566
        if (left_expr->element_index(i)->maybe_null)
1581
1567
        {
1582
 
          if (!(item= new Item_func_trig_cond(item, get_cond_guard(i))))
1583
 
            return(RES_ERROR);
1584
 
          if (!(having_col_item=
1585
 
                  new Item_func_trig_cond(having_col_item, get_cond_guard(i))))
1586
 
            return(RES_ERROR);
 
1568
          item= new Item_func_trig_cond(item, get_cond_guard(i));
 
1569
          having_col_item= new Item_func_trig_cond(having_col_item, get_cond_guard(i));
1587
1570
        }
1588
1571
        having_item= and_items(having_item, having_col_item);
1589
1572
      }
1857
1840
  if (! outer_join || ! outer_join->tables || ! outer_join->join_tab)
1858
1841
    return true;
1859
1842
 
1860
 
  if (!(left_expr_cache= new List<Cached_item>))
1861
 
    return true;
 
1843
  left_expr_cache= new List<Cached_item>;
1862
1844
 
1863
1845
  for (uint32_t i= 0; i < left_expr->cols(); i++)
1864
1846
  {