~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/archive_test.cc

  • Committer: Prafulla Tekawade
  • Date: 2010-08-06 11:21:12 UTC
  • mto: (1711.1.21 build) (1725.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: prafulla_t@users.sourceforge.net-20100806112112-7w5u0s3nx9u67nzt
Fix for Bug 586051

1. test_if_ref method which checks whether predicate is already evaluated
   due to ref/eq_ref access or not was incorrectly removing a predicate 
   that was not implicitly evaluated due to ref access (due to presence of filesort ?)
   It was field=NULL predicate.
   Such predicate should be kept and execution engine will filter out rows
   correctly. Removal of such predicate led to returning of rows which had
   NULL for join/predicate columns.
2. field COMP_OP NULL will always false for all fields except when COMP_OP
   is NULL-safe equality operator. Modified range optimizer to return zero
   row count in such cases.
   Query now does not even run. It returns zero result. As such Fix(1) is not
   required but we might hit that case in some other query (I have not tried it
   yet)
3. Fixed Field::val_str to print "NULL" for literal NULL instead of "0". It
   added lot of confusion while debugging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <fcntl.h>
23
23
#include <unistd.h>
24
24
#include <cstdlib>
25
 
#include <memory>
26
25
 
27
26
#if TIME_WITH_SYS_TIME
28
27
# include <sys/time.h>
35
34
# endif
36
35
#endif
37
36
 
38
 
#include <boost/scoped_ptr.hpp>
39
 
 
40
37
#define COMMENT_STRING "Your bases"
41
38
#define FRM_STRING "My bases"
42
39
#define TEST_FILENAME "test.az"
114
111
  int error;
115
112
  unsigned int x;
116
113
  int written_rows= 0;
117
 
  boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
118
 
  boost::scoped_ptr<azio_stream> reader_handle_ap(new azio_stream);
119
 
  azio_stream &writer_handle= *writer_handle_ap.get();
120
 
  azio_stream &reader_handle= *reader_handle_ap.get();
 
114
  azio_stream writer_handle, reader_handle;
121
115
 
122
116
  memcpy(test_string, TEST_STRING_INIT, 1024);
123
117
 
291
285
int size_test(uint64_t length, uint64_t rows_to_test_for,
292
286
              az_method method)
293
287
{
294
 
  boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
295
 
  boost::scoped_ptr<azio_stream> reader_handle_ap(new azio_stream);
296
 
  azio_stream &writer_handle= *writer_handle_ap.get();
297
 
  azio_stream &reader_handle= *reader_handle_ap.get();
 
288
  azio_stream writer_handle, reader_handle;
298
289
  uint64_t write_length;
299
290
  uint64_t read_length;
300
291
  uint64_t count;