~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/create.cc

  • Committer: Stewart Smith
  • Date: 2010-09-21 01:42:29 UTC
  • mto: (1786.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1787.
  • Revision ID: stewart@flamingspork.com-20100921014229-306eezx3akrskjti
move ELT() function to string_functions plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <drizzled/function/str/binary.h>
31
31
#include <drizzled/function/str/concat.h>
32
32
#include <drizzled/function/str/conv.h>
33
 
#include <drizzled/function/str/elt.h>
34
33
#include <drizzled/function/str/export_set.h>
35
34
#include <drizzled/function/str/format.h>
36
35
#include <drizzled/function/str/load_file.h>
431
430
  virtual ~Create_func_degrees() {}
432
431
};
433
432
 
434
 
 
435
 
class Create_func_elt : public Create_native_func
436
 
{
437
 
public:
438
 
  virtual Item *create_native(Session *session, LEX_STRING name, List<Item> *item_list);
439
 
 
440
 
  static Create_func_elt s_singleton;
441
 
 
442
 
protected:
443
 
  Create_func_elt() {}
444
 
  virtual ~Create_func_elt() {}
445
 
};
446
 
 
447
433
class Create_func_export_set : public Create_native_func
448
434
{
449
435
 
1393
1379
                                             180/M_PI, 0.0);
1394
1380
}
1395
1381
 
1396
 
 
1397
 
Create_func_elt Create_func_elt::s_singleton;
1398
 
 
1399
 
Item*
1400
 
Create_func_elt::create_native(Session *session, LEX_STRING name,
1401
 
                               List<Item> *item_list)
1402
 
{
1403
 
  int arg_count= 0;
1404
 
 
1405
 
  if (item_list != NULL)
1406
 
    arg_count= item_list->elements;
1407
 
 
1408
 
  if (arg_count < 2)
1409
 
  {
1410
 
    my_error(ER_WRONG_PARAMCOUNT_TO_FUNCTION, MYF(0), name.str);
1411
 
    return NULL;
1412
 
  }
1413
 
 
1414
 
  return new (session->mem_root) Item_func_elt(*item_list);
1415
 
}
1416
 
 
1417
1382
Create_func_export_set Create_func_export_set::s_singleton;
1418
1383
 
1419
1384
Item*
2067
2032
  { { C_STRING_WITH_LEN("DAYOFWEEK") }, BUILDER(Create_func_dayofweek)},
2068
2033
  { { C_STRING_WITH_LEN("DAYOFYEAR") }, BUILDER(Create_func_dayofyear)},
2069
2034
  { { C_STRING_WITH_LEN("DEGREES") }, BUILDER(Create_func_degrees)},
2070
 
  { { C_STRING_WITH_LEN("ELT") }, BUILDER(Create_func_elt)},
2071
2035
  { { C_STRING_WITH_LEN("EXPORT_SET") }, BUILDER(Create_func_export_set)},
2072
2036
  { { C_STRING_WITH_LEN("FIELD") }, BUILDER(Create_func_field)},
2073
2037
  { { C_STRING_WITH_LEN("FIND_IN_SET") }, BUILDER(Create_func_find_in_set)},