Hi!

Below is the column type mapping function from ha_innobase.cc.

But the internal column type inside InnoDB is not too important for the
user, because you can only see it in the output of innodb_table_monitor.

Best regards,

Heikki Tuuri
Innobase Oy
---
Order technical MySQL/InnoDB support at https://order.mysql.com/
See http://www.innodb.com for the online manual and latest news on InnoDB


/******************************************************************
Converts a MySQL type to an InnoDB type. */
inline
ulint
get_innobase_type_from_mysql_type(
/*==============================*/
   /* out: DATA_BINARY, DATA_VARCHAR, ... */
 Field* field) /* in: MySQL field */
{
 /* The following asserts check that MySQL type code fits in
 8 bits: this is used in ibuf and also when DATA_NOT_NULL is
 ORed to the type */

 dbug_assert((ulint)FIELD_TYPE_STRING < 256);
 dbug_assert((ulint)FIELD_TYPE_VAR_STRING < 256);
 dbug_assert((ulint)FIELD_TYPE_DOUBLE < 256);
 dbug_assert((ulint)FIELD_TYPE_FLOAT < 256);
 dbug_assert((ulint)FIELD_TYPE_DECIMAL < 256);

 switch (field->type()) {
  case FIELD_TYPE_VAR_STRING: if (field->flags & BINARY_FLAG) {

      return(DATA_BINARY);
     } else if (strcmp(
         default_charset_info->name,
       "latin1") == 0) {
      return(DATA_VARCHAR);
     } else {
      return(DATA_VARMYSQL);
     }
  case FIELD_TYPE_STRING: if (field->flags & BINARY_FLAG) {

      return(DATA_FIXBINARY);
     } else if (strcmp(
         default_charset_info->name,
       "latin1") == 0) {
      return(DATA_CHAR);
     } else {
      return(DATA_MYSQL);
     }
  case FIELD_TYPE_LONG:
  case FIELD_TYPE_LONGLONG:
  case FIELD_TYPE_TINY:
  case FIELD_TYPE_SHORT:
  case FIELD_TYPE_INT24:
  case FIELD_TYPE_DATE:
  case FIELD_TYPE_DATETIME:
  case FIELD_TYPE_YEAR:
  case FIELD_TYPE_NEWDATE:
  case FIELD_TYPE_ENUM:
  case FIELD_TYPE_SET:
  case FIELD_TYPE_TIME:
  case FIELD_TYPE_TIMESTAMP:
     return(DATA_INT);
  case FIELD_TYPE_FLOAT:
     return(DATA_FLOAT);
  case FIELD_TYPE_DOUBLE:
     return(DATA_DOUBLE);
  case FIELD_TYPE_DECIMAL:
     return(DATA_DECIMAL);
  case FIELD_TYPE_TINY_BLOB:
  case FIELD_TYPE_MEDIUM_BLOB:
  case FIELD_TYPE_BLOB:
  case FIELD_TYPE_LONG_BLOB:
     return(DATA_BLOB);
  default:
     assert(0);
 }

 return(0);
}



-----Original Message-----
From: Jeremy Zawodny <[EMAIL PROTECTED]>
To: Heikki Tuuri <[EMAIL PROTECTED]>
Cc: Philip Molter <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Friday, January 25, 2002 10:22 AM
Subject: Re: innoDB confusion


>On Tue, Jan 15, 2002 at 08:36:16PM +0200, Heikki Tuuri wrote:
>> >
>> >This brings up an interesting point.  If you've lost your .frm
>> >files, are you totally screwed, or does InnoDB contain enough
>> >information to restore those .frm files?  It's not a big deal if
>>
>> With some work, yes. innodb_table_monitor prints the internal schema of
>> InnoDB. There are fewer column types inside InnoDB than in MySQL. For
>> example, a DATE column will appear as an integer.
>
>Heikki,
>
>Is the list of column types that InnoDB suppots (as well as how they
>are mapped to MyISAM types) documented anywhere?  I didn't see it
>in the InnoDB manual?
>
>I'd like to put it in the InnoDB section of my book if I can get the
>right information. :-)
>
>Jeremy
>--
>Jeremy D. Zawodny, <[EMAIL PROTECTED]>
>Technical Yahoo - Yahoo Finance
>Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936
>
>MySQL 3.23.41-max: up 22 days, processed 514,398,369 queries (266/sec. avg)



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to