Below is the list of changes that have just been committed into a local
5.0 repository of anjuta. When anjuta 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1914 05/06/01 16:36:45 anjuta@stripped +6 -0
Fix for the bug #10355 - Incorrect error displayed if view is used in like clause when
creating a table.
And some minor indentations.
BitKeeper/etc/logging_ok
1.308 05/06/01 16:13:40 anjuta@stripped +1 -0
Logging to logging@stripped accepted
sql/table.cc
1.161 05/06/01 16:13:24 anjuta@stripped +17 -10
Fixed error codes reutrned by frm_error().
sql/sql_table.cc
1.241 05/06/01 16:13:24 anjuta@stripped +11 -1
Fix for the bug #10355 - Incorrect error displayed if view is used in like clause when
creating a table.
sql/sql_parse.cc
1.446 05/06/01 16:13:24 anjuta@stripped +2 -2
Indentation.
sql/share/errmsg.txt
1.30 05/06/01 16:13:23 anjuta@stripped +2 -0
Added new error message.
sql/handler.cc
1.167 05/06/01 16:12:11 anjuta@stripped +3 -4
Added some spaces.
# 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: anjuta
# Host: lancelot.mysql.com
# Root: /home/my/mysql-5.0-bugs
--- 1.166/sql/handler.cc 2005-04-30 03:46:36 +03:00
+++ 1.167/sql/handler.cc 2005-06-01 16:12:11 +03:00
@@ -1846,7 +1846,7 @@
char name_buff[FN_REFLEN];
DBUG_ENTER("ha_create_table");
- if (openfrm(current_thd, name,"",0,(uint) READ_ALL, 0, &table))
+ if (openfrm(current_thd, name, "", 0, (uint) READ_ALL, 0, &table))
DBUG_RETURN(1);
if (update_create_info)
{
@@ -1864,7 +1864,7 @@
error=table.file->create(name,&table,create_info);
VOID(closefrm(&table));
if (error)
- my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), name,error);
+ my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), name, error);
DBUG_RETURN(error != 0);
}
@@ -1910,8 +1910,7 @@
// Save the frm file
if ((error = writefrm(path, frmblob, frmlen)))
goto err_end;
-
- if (openfrm(thd, path,"",0,(uint) READ_ALL, 0, &table))
+ if (openfrm(thd, path, "", 0, (uint) READ_ALL, 0, &table))
DBUG_RETURN(1);
update_create_info_from_table(&create_info, &table);
--- 1.445/sql/sql_parse.cc 2005-05-02 20:19:33 +03:00
+++ 1.446/sql/sql_parse.cc 2005-06-01 16:13:24 +03:00
@@ -2827,8 +2827,8 @@
{
/* regular create */
if (lex->name)
- res= mysql_create_like_table(thd, create_table, &lex->create_info,
- (Table_ident *)lex->name);
+ res= mysql_create_like_table(thd, create_table, &lex->create_info,
+ (Table_ident *)lex->name);
else
{
res= mysql_create_table(thd, create_table->db,
--- 1.240/sql/sql_table.cc 2005-05-02 20:19:34 +03:00
+++ 1.241/sql/sql_table.cc 2005-06-01 16:13:24 +03:00
@@ -2525,7 +2525,9 @@
/*
Validate the source table
- */
+ */
+
+
if (table_ident->table.length > NAME_LEN ||
(table_ident->table.length &&
check_table_name(src_table,table_ident->table.length)) ||
@@ -2535,6 +2537,7 @@
DBUG_RETURN(TRUE);
}
+
bzero((gptr)&src_tables_list, sizeof(src_tables_list));
src_tables_list.db= table_ident->db.str ? table_ident->db.str : thd->db;
src_tables_list.table_name= table_ident->table.str;
@@ -2557,6 +2560,13 @@
my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
goto err;
}
+ /* check if table is a frm, if not, give error */
+ if (mysql_frm_type(src_path)!=FRMTYPE_TABLE)
+ {
+ my_error(ER_NO_VIEW, MYF(0), src_path);
+ goto err;
+ }
+
}
/*
--- 1.160/sql/table.cc 2005-04-12 10:27:37 +03:00
+++ 1.161/sql/table.cc 2005-06-01 16:13:24 +03:00
@@ -46,8 +46,7 @@
name path to table-file "db/name"
alias alias for table
- db_stat open flags (for example HA_OPEN_KEYFILE|HA_OPEN_RNDFILE..)
- can be 0 (example in ha_example_table)
+ db_stat open flags (for example HA_OPEN_KEYFILE|HA_OPEN_RNDFILE..)
can be 0 (example in ha_example_table)
prgflag READ_ALL etc..
ha_open_flags HA_OPEN_ABORT_IF_LOCKED etc..
outparam result table
@@ -58,7 +57,8 @@
2 Error (see frm_error)
3 Wrong data in .frm file
4 Error (see frm_error)
- 5 Error (see frm_error: charset unavailable)
+ 5 Error (see frm_error: operation not permitted on a view)
+ 6 Error (see frm_error: charset unavailable)
*/
int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
@@ -111,15 +111,15 @@
if (memcmp(head, "TYPE=", 5) == 0)
{
- // new .frm
- my_close(file,MYF(MY_WME));
-
if (db_stat & NO_ERR_ON_NEW_FRM)
+ {
+ my_close(file,MYF(MY_WME));
DBUG_RETURN(5);
- file= -1;
- // caller can't process new .frm
+ }
+ error= 5; // caller can't process new .frm
goto err;
}
+ db_stat&= ~NO_ERR_ON_NEW_FRM;
share->blob_ptr_size= sizeof(char*);
outparam->db_stat= db_stat;
@@ -490,7 +490,7 @@
charset= &my_charset_bin;
else if (!(charset=get_charset((uint) strpos[14], MYF(0))))
{
- error= 5; // Unknown or unavailable charset
+ error= 6; // Unknown or unavailable charset
errarg= (int) strpos[14];
goto err;
}
@@ -1071,7 +1071,13 @@
break;
}
case 5:
- {
+ {
+ my_error(ER_NO_VIEW, errortype,
+ fn_format(buff, name, form_dev, reg_ext, 0));
+ break;
+ }
+ case 6:
+ {
const char *csname= get_charset_name((uint) errarg);
char tmp[10];
if (!csname || csname[0] =='?')
@@ -1083,6 +1089,7 @@
"Unknown collation '%s' in table '%-.64s' definition",
MYF(0), csname, real_name);
break;
+
}
default: /* Better wrong error than none */
case 4:
--- 1.29/sql/share/errmsg.txt 2005-04-29 18:21:57 +03:00
+++ 1.30/sql/share/errmsg.txt 2005-06-01 16:13:23 +03:00
@@ -5346,3 +5346,5 @@
eng "Not allowed to return a result set from a function"
ER_CANT_CREATE_GEOMETRY_OBJECT 22003
eng "Cannot get geometry object from data you send to the GEOMETRY field"
+ER_NO_VIEW
+ eng "Operation can't be permitted for view '%-.64s'"
--- 1.307/BitKeeper/etc/logging_ok 2005-05-03 18:47:51 +03:00
+++ 1.308/BitKeeper/etc/logging_ok 2005-06-01 16:13:40 +03:00
@@ -14,6 +14,7 @@
ahlentz@stripped
akishkin@stripped
anjuta@stripped
+anjuta@stripped
antony@stripped
antony@stripped
antony@stripped
| Thread |
|---|
| • bk commit into 5.0 tree (anjuta:1.1914) BUG#10355 | Anjuta Widenius | 1 Jun |