MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:July 17 2009 10:19am
Subject:Re: [Branch ~mysql-infoschema-2009/mysql-infoschema/trunk] Rev 3184
View as plain text  
Hi, noreply!

On Jul 17, noreply@stripped wrote:
> ------------------------------------------------------------
> revno: 3184
> committer: Robin <scut_tang@stripped>
> branch nick: test
> timestamp: Fri 2009-07-17 16:33:08 +0800
> message:
>   1. Fixed TABLE_SHARE->default_values. SHOW CREATE INFOSCHEMA.ENGINES looks
> good.
>   2. Change TABLE_SHARE->table_charset from default_charset_info to
> system_charset_info.
>   3. Fixed TABLE_SHARE->field[...] members: ptr, null_ptr, null_bit.
>   4. I_S tables: ENGINES, COLLATIONS, CHARACTER_SETS can show data to user. But after
> second select on the
>      same table, the title of table looks strange.

The changes look good.

Suggestion - in ~/.bazaar/bazaar.conf add

[DEFAULT]
per_file_commits = On

and in 'bzr gcommit' write per-file comments, where appropriate.

> === modified file 'storage/infoschema/ha_infoschema.cc'
> --- storage/infoschema/ha_infoschema.cc	2009-07-16 11:18:01 +0000
> +++ storage/infoschema/ha_infoschema.cc	2009-07-17 08:33:08 +0000
> @@ -480,7 +492,24 @@
>  	}
>  
>  	share->default_values = record;
> -	share->null_bytes = (share->null_fields + 7) / 8;
> +	for(null_count = reclength = fieldnr = 0;
> +			fieldnr < field_count;
> +			fieldnr++)
> +	{
> +		Field *field = share->field[fieldnr];
> +		field->ptr = record + share->null_bytes + reclength;
> +		if(!(field->flags & NOT_NULL_FLAG))
> +		{
> +			field->null_ptr = record + null_count / 8;
> +			field->null_bit = 1 << (null_count & 7);
> +			null_count++;
> +		}
> +		field->reset();
> +		if(field->type() == MYSQL_TYPE_BLOB)
> +			reclength += field->row_pack_length() + share->blob_ptr_size;
> +		else
> +			reclength += field->pack_length();
> +	}
>  
>  	thd->status_var.opened_shares++;

Ok, I'm repeating again: please change all your code to follow MySQL
coding conventions. In particular:
 - use spaces, not tabs
 - indentation is two spaces
 - no space before assignment, one space after
 - a space after if, for, etc.

the first two rules are the most important, from now on I'm not going to
review any code of yours if it'll have incorrect indentation!

Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
Re: [Branch ~mysql-infoschema-2009/mysql-infoschema/trunk] Rev 3184Sergei Golubchik18 Jul
Re: [Branch ~mysql-infoschema-2009/mysql-infoschema/trunk] Rev 3184Sergei Golubchik18 Jul