Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: question about Field::null_ptr

From: Ingo Strüwing <ingo(at)mysql.com>
Date: Thu Jul 12 2007 - 12:56:44 EDT


Hi,

Vangelis Katsikaros wrote:
> Hello
> I would like to ask about the
> uchar* Field::null_ptr // Byte where null_bit is
> uchar Field::null_bit // Bit used to test null bit
>
> What I would like to aks is what null "thing" they are used for. It's
> about whether the field is used in a IS NULL, NOT NULL etc?

The NULL bits are used for columns that can have a NULL value. One bit is sufficient to tell if the column value is NULL or not.

One byte has 8 bits. So we need (number of non-not-NULL columns + 7) / 8 bytes to encode NULL values for all columns.

null_ptr points to the byte in wich we have the bit for this column (field). null_bit is the number of the bit within that byte.

Regards
Ingo

-- 
Ingo Strüwing, Senior Software Developer
MySQL GmbH, Radlkoferstr. 2, D-81373 München
Geschäftsführer: Kaj Arnö - HRB München 162140

-- 
MySQL Internals Mailing List
For list archives: 
http://lists.mysql.com/internals
To unsubscribe:    
http://lists.mysql.com/internals?unsub=lists@pantek.com
Received on Thu Jul 12 12:56:59 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 02 2007 - 01:57:05 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library