~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

doStartTableScan() result not checked.

Add __attribute__((warn_unused_result)) to Cursor::startTableScan()
and by extension init_read_records

then go and fix the places where we weren't checking for errors.

This patch helped by Monty Widenius' patch to MariaDB. Greatly increased
confidence that we either handle the errors correctly or are at least
on par with bugs :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
namespace drizzled
45
45
{
46
46
 
47
 
class st_lex_symbol;
48
47
class select_result_interceptor;
49
48
 
50
49
/* YACC and LEX Definitions */
931
930
     statement in a session. It's re-used by doing lex_end, lex_start
932
931
     in sql_lex.cc
933
932
  */
934
 
  virtual ~LEX();
 
933
  virtual ~LEX()
 
934
  {
 
935
  }
935
936
 
936
937
  TableList *unlink_first_table(bool *link_to_local);
937
938
  void link_first_table_back(TableList *first, bool link_to_local);
994
995
  void reset()
995
996
  {
996
997
    sum_expr_used= false;
997
 
    _exists= false;
998
998
  }
999
999
 
1000
1000
  void setSumExprUsed()
1010
1010
  void start(Session *session);
1011
1011
  void end();
1012
1012
 
1013
 
  message::Table *table()
1014
 
  {
1015
 
    if (not _create_table)
1016
 
      _create_table= new message::Table;
1017
 
 
1018
 
    return _create_table;
1019
 
  }
1020
 
 
1021
 
  message::Table::Field *field()
1022
 
  {
1023
 
    return _create_field;
1024
 
  }
1025
 
 
1026
 
  void setField(message::Table::Field *arg)
1027
 
  {
1028
 
    _create_field= arg;
1029
 
  }
1030
 
 
1031
 
  void setExists()
1032
 
  {
1033
 
    _exists= true;
1034
 
  }
1035
 
 
1036
 
  bool exists() const
1037
 
  {
1038
 
    return _exists;
1039
 
  }
1040
 
 
1041
1013
private: 
1042
1014
  bool cacheable;
1043
1015
  bool sum_expr_used;
1044
 
  message::Table *_create_table;
1045
 
  message::Table::Field *_create_field;
1046
 
  bool _exists;
1047
1016
};
1048
1017
 
1049
1018
extern void lex_start(Session *session);
1050
1019
extern void trim_whitespace(const CHARSET_INFO * const cs, LEX_STRING *str);
1051
1020
extern bool is_lex_native_function(const LEX_STRING *name);
1052
1021
 
1053
 
bool check_for_sql_keyword(drizzled::st_lex_symbol const&);
1054
 
bool check_for_sql_keyword(drizzled::lex_string_t const&);
1055
 
 
1056
1022
/**
1057
1023
  @} (End of group Semantic_Analysis)
1058
1024
*/