Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1557 03/03/25 13:38:05 bar@xxxxxxxxxxxxxxxx +5 -0
Two separate commands: SHOW COLLATION and SHOW CHARACTER SET
sql/sql_yacc.yy
1.266 03/03/25 13:38:03 bar@xxxxxxxxxxxxxxxx +2 -0
Two separate commands: SHOW COLLATION and SHOW CHARACTER SET
sql/sql_show.cc
1.119 03/03/25 13:38:03 bar@xxxxxxxxxxxxxxxx +70 -18
Two separate commands: SHOW COLLATION and SHOW CHARACTER SET
sql/sql_parse.cc
1.284 03/03/25 13:38:03 bar@xxxxxxxxxxxxxxxx +3 -0
Two separate commands: SHOW COLLATION and SHOW CHARACTER SET
sql/sql_lex.h
1.128 03/03/25 13:38:03 bar@xxxxxxxxxxxxxxxx +1 -1
Two separate commands: SHOW COLLATION and SHOW CHARACTER SET
sql/mysql_priv.h
1.192 03/03/25 13:38:03 bar@xxxxxxxxxxxxxxxx +1 -0
Two separate commands: SHOW COLLATION and SHOW CHARACTER SET
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: bar
# Host: bar.mysql.r18.ru
# Root: /usr/home/bar/mysql-4.1
--- 1.191/sql/mysql_priv.h Fri Mar 21 11:20:59 2003
+++ 1.192/sql/mysql_priv.h Tue Mar 25 13:38:03 2003
@@ -528,6 +528,7 @@
int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
enum enum_var_type value_type);
int mysqld_show_charsets(THD *thd,const char *wild);
+int mysqld_show_collations(THD *thd,const char *wild);
int mysqld_show_table_types(THD *thd);
int mysqld_show_privileges(THD *thd);
int mysqld_show_column_types(THD *thd);
--- 1.127/sql/sql_lex.h Tue Mar 18 17:01:30 2003
+++ 1.128/sql/sql_lex.h Tue Mar 25 13:38:03 2003
@@ -52,7 +52,7 @@
SQLCOM_SHOW_INNODB_STATUS,
SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
- SQLCOM_SHOW_CREATE_DB,
+ SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB,
SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES,
SQLCOM_GRANT,
--- 1.283/sql/sql_parse.cc Thu Mar 20 00:25:43 2003
+++ 1.284/sql/sql_parse.cc Tue Mar 25 13:38:03 2003
@@ -2566,6 +2566,9 @@
case SQLCOM_SHOW_CHARSETS:
res= mysqld_show_charsets(thd,(lex->wild ? lex->wild->ptr() : NullS));
break;
+ case SQLCOM_SHOW_COLLATIONS:
+ res= mysqld_show_collations(thd,(lex->wild ? lex->wild->ptr() : NullS));
+ break;
case SQLCOM_SHOW_FIELDS:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error(thd,ER_NOT_ALLOWED_COMMAND); /* purecov: inspected */
--- 1.118/sql/sql_show.cc Thu Mar 20 04:06:06 2003
+++ 1.119/sql/sql_show.cc Tue Mar 25 13:38:03 2003
@@ -1414,7 +1414,22 @@
Status functions
*****************************************************************************/
-int mysqld_show_charsets(THD *thd, const char *wild)
+static bool write_collation(Protocol *protocol, CHARSET_INFO *cs)
+{
+ char flags[4];
+ protocol->prepare_for_resend();
+ protocol->store(cs->csname, system_charset_info);
+ protocol->store(cs->name, system_charset_info);
+ protocol->store_short((longlong) cs->number);
+ flags[0]='\0';
+ if (cs->state & MY_CS_PRIMARY)
+ strcat(flags,"def");
+ protocol->store(flags, system_charset_info);
+ protocol->store_short((longlong) cs->strxfrm_multiply);
+ return protocol->write();
+}
+
+int mysqld_show_collations(THD *thd, const char *wild)
{
char buff[8192];
String packet2(buff,sizeof(buff),thd->charset());
@@ -1425,32 +1440,69 @@
DBUG_ENTER("mysqld_show_charsets");
- field_list.push_back(new Item_empty_string("CS_Name",30));
- field_list.push_back(new Item_empty_string("COL_Name",30));
+ field_list.push_back(new Item_empty_string("Charset",30));
+ field_list.push_back(new Item_empty_string("Collation",30));
field_list.push_back(new Item_return_int("Id",11, FIELD_TYPE_SHORT));
field_list.push_back(new Item_empty_string("Flags",30));
- field_list.push_back(new Item_return_int("strx_maxlen",3, FIELD_TYPE_TINY));
- field_list.push_back(new Item_return_int("mb_maxlen",3, FIELD_TYPE_TINY));
+ field_list.push_back(new Item_return_int("strx_maxlen",3, FIELD_TYPE_SHORT));
if (protocol->send_fields(&field_list, 1))
DBUG_RETURN(1);
- for (cs=all_charsets ; cs < all_charsets+255 ; cs++ )
+ for ( cs= all_charsets ; cs < all_charsets+255 ; cs++ )
{
- if (cs[0] && !(wild && wild[0] &&
+ CHARSET_INFO **cl;
+ for ( cl= all_charsets; cl < all_charsets+255 ;cl ++)
+ {
+ if (!cs[0] || !cl[0] || !my_charset_same(cs[0],cl[0]) || !(cs[0]->state
& MY_CS_PRIMARY))
+ continue;
+ if (cs[0] && !(wild && wild[0] &&
wild_case_compare(system_charset_info,cs[0]->name,wild)))
+ {
+ if (write_collation(protocol, cl[0]))
+ goto err;
+ }
+ }
+ }
+ send_eof(thd);
+ DBUG_RETURN(0);
+err:
+ DBUG_RETURN(1);
+}
+
+static bool write_charset(Protocol *protocol, CHARSET_INFO *cs)
+{
+ protocol->prepare_for_resend();
+ protocol->store(cs->csname, system_charset_info);
+ protocol->store(cs->name, system_charset_info);
+ protocol->store_short((longlong) cs->mbmaxlen);
+ return protocol->write();
+}
+
+int mysqld_show_charsets(THD *thd, const char *wild)
+{
+ char buff[8192];
+ String packet2(buff,sizeof(buff),thd->charset());
+ List<Item> field_list;
+ CHARSET_INFO **cs;
+ Protocol *protocol= thd->protocol;
+ char flags[64];
+
+ DBUG_ENTER("mysqld_show_charsets");
+
+ field_list.push_back(new Item_empty_string("Charset",30));
+ field_list.push_back(new Item_empty_string("Default collation",60));
+ field_list.push_back(new Item_return_int("Maxlen",3, FIELD_TYPE_SHORT));
+
+ if (protocol->send_fields(&field_list, 1))
+ DBUG_RETURN(1);
+
+ for ( cs= all_charsets ; cs < all_charsets+255 ; cs++ )
+ {
+ if (cs[0] && (cs[0]->state & MY_CS_PRIMARY) && !(wild && wild[0] &&
+ wild_case_compare(system_charset_info,cs[0]->name,wild)))
{
- protocol->prepare_for_resend();
- protocol->store(cs[0]->csname, system_charset_info);
- protocol->store(cs[0]->name, system_charset_info);
- protocol->store_short((longlong) cs[0]->number);
- flags[0]='\0';
- if (cs[0]->state & MY_CS_PRIMARY)
- strcat(flags,"pri");
- protocol->store(flags, system_charset_info);
- protocol->store_tiny((longlong) cs[0]->strxfrm_multiply);
- protocol->store_tiny((longlong) cs[0]->mbmaxlen);
- if (protocol->write())
+ if (write_charset(protocol, cs[0]))
goto err;
}
}
--- 1.265/sql/sql_yacc.yy Fri Mar 21 15:42:30 2003
+++ 1.266/sql/sql_yacc.yy Tue Mar 25 13:38:03 2003
@@ -3578,6 +3578,8 @@
}
| charset wild
{ Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
+ | COLLATION_SYM wild
+ { Lex->sql_command= SQLCOM_SHOW_COLLATIONS; }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
| GRANTS FOR_SYM user
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:
http://lists.mysql.com/internals?unsub=gcdmd-internals@xxxxxxxxxxx
|