List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:November 10 2005 7:16pm
Subject:Re: bk commit into 5.1 tree (brian:1.1946)
View as plain text  
general comment: we need to make it possible to disable this, especially
for the embedded server. (just checking a #define that can be set via
CXXFLAGS is enough, i think.)

On Thu, Nov 10, 2005 at 07:45:19PM +0200, Brian Aker wrote:
> --- 1.170/sql/field.h	2005-11-04 22:09:54 +02:00
> +++ 1.171/sql/field.h	2005-11-10 19:42:27 +02:00
> @@ -1081,7 +1081,7 @@
>    int cmp_max(const char *, const char *, uint max_length);
>    int cmp(const char *a,const char*b)
>    {
> -    return cmp_max(a, b, ~0);
> +    return cmp_max(a, b, ~0L);
>    }
>    void sort_string(char *buff,uint length);
>    void get_key_image(char *buff,uint length, imagetype type);
> @@ -1141,7 +1141,7 @@
>    my_decimal *val_decimal(my_decimal *);
>    int cmp_max(const char *, const char *, uint max_length);
>    int cmp(const char *a,const char*b)
> -    { return cmp_max(a, b, ~0); }
> +    { return cmp_max(a, b, ~0L); }
>    int cmp(const char *a, uint32 a_length, const char *b, uint32 b_length);
>    int cmp_binary(const char *a,const char *b, uint32 max_length=~0L);
>    int key_cmp(const byte *,const byte*);

this should be its own changeset.

> --- 1.275/sql/sql_show.cc	2005-11-07 17:24:44 +02:00
> +++ 1.276/sql/sql_show.cc	2005-11-10 19:42:32 +02:00
> @@ -23,6 +23,7 @@
>  #include "sp.h"
>  #include "sp_head.h"
>  #include "sql_trigger.h"
> +#include "authors.h"
>  #include <my_dir.h>
>  
>  
> @@ -83,6 +84,38 @@
>    DBUG_RETURN(FALSE);
>  }
>  
> +/***************************************************************************
> +** List all Authors.
> +** If you can update it, you get to be in it :)
> +***************************************************************************/
> +
> +bool mysqld_show_authors(THD *thd)
> +{
> +  List<Item> field_list;
> +  Protocol *protocol= thd->protocol;
> +  DBUG_ENTER("mysqld_show_authors");
> +
> +  field_list.push_back(new Item_empty_string("Name",40));
> +  field_list.push_back(new Item_empty_string("Location",40));
> +  field_list.push_back(new Item_empty_string("Comment",80));
> +
> +  if (protocol->send_fields(&field_list,
> +                            Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
> +    DBUG_RETURN(TRUE);
> +
> +  show_table_authors_st *authors;
> +  for (authors= show_table_authors; authors->name; authors++)
> +  {
> +    protocol->prepare_for_resend();
> +    protocol->store(authors->name, system_charset_info);
> +    protocol->store(authors->location, system_charset_info);
> +    protocol->store(authors->comment, system_charset_info);
> +    if (protocol->write())
> +      DBUG_RETURN(TRUE);
> +  }
> +  send_eof(thd);
> +  DBUG_RETURN(FALSE);
> +}
>  
>  /***************************************************************************
>   List all privileges supported
> 
> --- 1.419/sql/sql_yacc.yy	2005-11-07 17:24:44 +02:00
> +++ 1.420/sql/sql_yacc.yy	2005-11-10 19:42:33 +02:00
> @@ -137,6 +137,7 @@
>  %token  ASCII_SYM
>  %token  ASENSITIVE_SYM
>  %token  ATAN
> +%token  AUTHORS_SYM
>  %token  AUTO_INC
>  %token  AVG_ROW_LENGTH
>  %token  AVG_SYM
> @@ -7174,6 +7175,11 @@
>  	    LEX *lex=Lex;
>  	    lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
>  	  }
> +	| AUTHORS_SYM
> +	  {
> +	    LEX *lex=Lex;
> +	    lex->sql_command= SQLCOM_SHOW_AUTHORS;
> +	  }
>  	| PRIVILEGES
>  	  {
>  	    LEX *lex=Lex;
> @@ -8171,6 +8177,7 @@
>  keyword:
>  	keyword_sp		{}
>  	| ASCII_SYM		{}
> +	| AUTHORS_SYM		{}
>  	| BACKUP_SYM		{}
>  	| BEGIN_SYM		{}
>  	| BYTE_SYM		{}
> --- New file ---
> +++ sql/authors.h	05/11/10 19:42:34
> /***************************************************************************
> ** Output from "SHOW AUTHORS"
> ** If you can update it, you get to be in it :)
> ** Dont be offended if your name is not in here, just add it!
> ***************************************************************************/

should mention what character set is used for this data. (and it should
be utf-8.)

> 
> struct show_table_authors_st {
>   const char *name;
>   const char *location;
>   const char *comment;
> };
> 
> struct show_table_authors_st show_table_authors[]= {
>   { "Brian \"Krow\" Aker", "Seattle, WA. USA", 
>     "Architecture, archive, federated, buncha of little stuff :)" },

'buncha of little stuff'? lose the 'a' or 'of'. ;)

i would use a comma after the state, and perhaps even spell it out.

>   { "David Axmark", "Uppsala, Sweden", "Small stuff long time ago, Monty ripped it
> out!"},
>   {NULL, NULL, NULL}
> };
> 
> 
> --- 1.76/mysql-test/r/show_check.result	2005-11-07 17:24:34 +02:00
> +++ 1.77/mysql-test/r/show_check.result	2005-11-10 19:42:24 +02:00
> @@ -564,3 +564,7 @@
>  DROP TABLE urkunde;
>  SHOW TABLES FROM non_existing_database;
>  ERROR 42000: Unknown database 'non_existing_database'
> +SHOW AUTHORS;
> +Name	Location	Comment
> +Brian "Krow" Aker	Seattle, WA. USA	Architecture, archive, federated, buncha of
> little stuff :)
> +David Axmark	Uppsala, Sweden	Small stuff long time ago, Monty ripped it out!
> 
> --- 1.55/mysql-test/t/show_check.test	2005-11-07 17:24:35 +02:00
> +++ 1.56/mysql-test/t/show_check.test	2005-11-10 19:42:26 +02:00
> @@ -424,3 +424,7 @@
>  #
>  --error 1049
>  SHOW TABLES FROM non_existing_database;
> +
> +# End of 4.1 tests
> +#
> +SHOW AUTHORS;

should disable query output here, otherwise we just have to update the
show_check.result file every time we add someone.

> 
> --- 1.30/sql/sql_cache.h	2005-09-06 20:51:08 +03:00
> +++ 1.31/sql/sql_cache.h	2005-11-10 19:42:31 +02:00
> @@ -215,6 +215,8 @@
>  
>  struct Query_cache_memory_bin_step
>  {
> +public:
> +  Query_cache_memory_bin_step() {}
>    ulong size;
>    ulong increment;
>    uint idx;

should also be in a different changeset.

jim
Thread
bk commit into 5.1 tree (brian:1.1946)Brian Aker10 Nov
  • Re: bk commit into 5.1 tree (brian:1.1946)Jim Winstead10 Nov