List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:May 31 2011 3:22pm
Subject:Re: bzr commit into mysql-trunk branch (mayank.prasad:3134) WL#5885
View as plain text  
Hi, Mayank!

On May 31, Mayank Prasad wrote:
>  3134 Mayank Prasad	2011-05-31
>       WL#5885 : TIME/TIMESTAMP/DATETIME with fractional seconds, information_schema

> @@ -4248,13 +4249,19 @@ void store_column_type(TABLE *table, Fie
>    {
>      /* CHARACTER_SET_NAME column*/
>      tmp_buff= field->charset()->csname;
> -    table->field[offset + 5]->store(tmp_buff, strlen(tmp_buff), cs);
> -    table->field[offset + 5]->set_notnull();
> -    /* COLLATION_NAME column */
> -    tmp_buff= field->charset()->name;
>      table->field[offset + 6]->store(tmp_buff, strlen(tmp_buff), cs);
>      table->field[offset + 6]->set_notnull();
> +    /* COLLATION_NAME column */
> +    tmp_buff= field->charset()->name;
> +    table->field[offset + 7]->store(tmp_buff, strlen(tmp_buff), cs);
> +    table->field[offset + 7]->set_notnull();
>    }
> +  if (!field->has_dtprecision())
> +  {
> +    /* DATETIME_PRECISION column*/
> +    table->field[offset + 5]->store(field->dtprecision(), TRUE);
> +    table->field[offset + 5]->set_notnull();
> +  }    
>  }

Why would you need a new virtual method here?
Just few lines above you have switch on a field_type.
Simply add

  case MYSQL_TYPE_DATETIME:
  case MYSQL_TYPE_TIMESTAMP:
  case MYSQL_TYPE_TIME:
    /* DATETIME_PRECISION column*/
    table->field[offset + 5]->store(field->decimals(), TRUE);
    table->field[offset + 5]->set_notnull();

and that's all.

Regards,
Sergei

Thread
bzr commit into mysql-trunk branch (mayank.prasad:3134) WL#5885Mayank Prasad31 May
  • Re: bzr commit into mysql-trunk branch (mayank.prasad:3134) WL#5885Sergei Golubchik31 May