~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/row0ext.h

  • 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:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify it under
6
 
the terms of the GNU General Public License as published by the Free Software
7
 
Foundation; version 2 of the License.
8
 
 
9
 
This program is distributed in the hope that it will be useful, but WITHOUT
10
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
 
 
13
 
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/**************************************************//**
20
 
@file include/row0ext.h
21
 
Caching of externally stored column prefixes
22
 
 
23
 
Created September 2006 Marko Makela
24
 
*******************************************************/
25
 
 
26
 
#ifndef row0ext_h
27
 
#define row0ext_h
28
 
 
29
 
#include "univ.i"
30
 
#include "row0types.h"
31
 
#include "data0types.h"
32
 
#include "mem0mem.h"
33
 
 
34
 
/********************************************************************//**
35
 
Creates a cache of column prefixes of externally stored columns.
36
 
@return own: column prefix cache */
37
 
UNIV_INTERN
38
 
row_ext_t*
39
 
row_ext_create(
40
 
/*===========*/
41
 
        ulint           n_ext,  /*!< in: number of externally stored columns */
42
 
        const ulint*    ext,    /*!< in: col_no's of externally stored columns
43
 
                                in the InnoDB table object, as reported by
44
 
                                dict_col_get_no(); NOT relative to the records
45
 
                                in the clustered index */
46
 
        const dtuple_t* tuple,  /*!< in: data tuple containing the field
47
 
                                references of the externally stored
48
 
                                columns; must be indexed by col_no;
49
 
                                the clustered index record must be
50
 
                                covered by a lock or a page latch
51
 
                                to prevent deletion (rollback or purge). */
52
 
        ulint           zip_size,/*!< compressed page size in bytes, or 0 */
53
 
        mem_heap_t*     heap);  /*!< in: heap where created */
54
 
 
55
 
/********************************************************************//**
56
 
Looks up a column prefix of an externally stored column.
57
 
@return column prefix, or NULL if the column is not stored externally,
58
 
or pointer to field_ref_zero if the BLOB pointer is unset */
59
 
UNIV_INLINE
60
 
const byte*
61
 
row_ext_lookup_ith(
62
 
/*===============*/
63
 
        const row_ext_t*        ext,    /*!< in/out: column prefix cache */
64
 
        ulint                   i,      /*!< in: index of ext->ext[] */
65
 
        ulint*                  len);   /*!< out: length of prefix, in bytes,
66
 
                                        at most REC_MAX_INDEX_COL_LEN */
67
 
/********************************************************************//**
68
 
Looks up a column prefix of an externally stored column.
69
 
@return column prefix, or NULL if the column is not stored externally,
70
 
or pointer to field_ref_zero if the BLOB pointer is unset */
71
 
UNIV_INLINE
72
 
const byte*
73
 
row_ext_lookup(
74
 
/*===========*/
75
 
        const row_ext_t*        ext,    /*!< in: column prefix cache */
76
 
        ulint                   col,    /*!< in: column number in the InnoDB
77
 
                                        table object, as reported by
78
 
                                        dict_col_get_no(); NOT relative to the
79
 
                                        records in the clustered index */
80
 
        ulint*                  len);   /*!< out: length of prefix, in bytes,
81
 
                                        at most REC_MAX_INDEX_COL_LEN */
82
 
 
83
 
/** Prefixes of externally stored columns */
84
 
struct row_ext_struct{
85
 
        ulint           n_ext;  /*!< number of externally stored columns */
86
 
        const ulint*    ext;    /*!< col_no's of externally stored columns */
87
 
        byte*           buf;    /*!< backing store of the column prefix cache */
88
 
        ulint           len[1]; /*!< prefix lengths; 0 if not cached */
89
 
};
90
 
 
91
 
#ifndef UNIV_NONINL
92
 
#include "row0ext.ic"
93
 
#endif
94
 
 
95
 
#endif