~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/fsp0fsp.ic

  • Committer: Stewart Smith
  • Date: 2009-05-15 06:57:12 UTC
  • mto: (991.1.5 for-brian)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: stewart@flamingspork.com-20090515065712-bmionylacjmexmmm
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle.

Also fix DEFAULT keyword handling for auto-increment so that it defaults to
NULL and not 0 so that the following is valid and generates two auto-inc
values:

create table t1 (a int auto_increment primary key)
insert into t1 (a) values (default);
insert into t1 (a) values (default);

Important to note that 0 is no longer magic. So this gives you duplicate
primary key error:

insert into t1 (a) values(0);
insert into t1 (a) values(0);

as you've inserted the explicit value of 0 twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 1995, 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/fsp0fsp.ic
21
 
File space management
22
 
 
23
 
Created 12/18/1995 Heikki Tuuri
24
 
*******************************************************/
25
 
 
26
 
/***********************************************************************//**
27
 
Checks if a page address is an extent descriptor page address.
28
 
@return TRUE if a descriptor page */
29
 
UNIV_INLINE
30
 
ibool
31
 
fsp_descr_page(
32
 
/*===========*/
33
 
        ulint   zip_size,/*!< in: compressed page size in bytes;
34
 
                        0 for uncompressed pages */
35
 
        ulint   page_no)/*!< in: page number */
36
 
{
37
 
        ut_ad(ut_is_2pow(zip_size));
38
 
 
39
 
        if (!zip_size) {
40
 
                return(UNIV_UNLIKELY((page_no & (UNIV_PAGE_SIZE - 1))
41
 
                                     == FSP_XDES_OFFSET));
42
 
        }
43
 
 
44
 
        return(UNIV_UNLIKELY((page_no & (zip_size - 1)) == FSP_XDES_OFFSET));
45
 
}