Wednesday, January 28, 2009

Innodb data types mapped to mysql data types

Today, I found the function in Innodb which maps Mysql data types to innodb data types. It is get_innobase_type_from_mysql_type which is located in the file ha_innodb.cc. The function takes an input parameter of type Field from mysql classes. This filed is then analyzed to set an output function paremeter that indicates whether the field is signed or unsigned and then the return value of the function is a macro integer code. The codes are defined in data0type.h as follows:

/*-------------------------------------------*/
/* The 'MAIN TYPE' of a column */
#define DATA_VARCHAR 1
#define DATA_CHAR 2
#define DATA_FIXBINARY 3
#define DATA_BINARY 4
#define DATA_BLOB 5
#define DATA_INT 6
#define DATA_SYS_CHILD 7
#define DATA_SYS 8
#define DATA_FLOAT 9
#define DATA_DOUBLE 10
#define DATA_DECIMAL 11
#define DATA_VARMYSQL 12
#define DATA_MYSQL 13
#define DATA_MTYPE_MAX 63
/*-------------------------------------------*/


More info on the data types in a later post.
Ivan

1 comment:

  1. Buying a piece of jewelry for him is thpmas sabo not as tricky as it might seem.thoughtfully-picked piece of jewelry. thomas sabo charms Here are five suggestions for when you are considering buying thomas sabo bracelets jewelry for him:A timepiece: Every man needs a reliable timepiece. thomas sabo charm carriers You have three different options to work with: thomas sabo watches A dress watch: Men with office thomas sabo charm pearl jobs need a watch that complements their suits.

    ReplyDelete