Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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.1891 05/07/22 12:35:15 jimw@stripped +9 -0
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
sql/unireg.cc
1.64 05/07/22 12:35:11 jimw@stripped +1 -2
Resolve conflict
sql/table.cc
1.173 05/07/22 12:35:11 jimw@stripped +3 -4
Resolve conflict
sql/mysql_priv.h
1.332 05/07/22 12:35:11 jimw@stripped +1 -2
Resolve conflict
mysql-test/t/create.test
1.56 05/07/22 12:35:10 jimw@stripped +0 -1
Resolve conflict
sql/sql_table.cc
1.264 05/07/22 12:32:27 jimw@stripped +0 -0
Auto merged
sql/item_strfunc.cc
1.245 05/07/22 12:32:27 jimw@stripped +0 -0
Auto merged
mysql-test/t/func_str.test
1.78 05/07/22 12:32:27 jimw@stripped +0 -0
Auto merged
mysql-test/r/func_str.result
1.104 05/07/22 12:32:27 jimw@stripped +0 -0
Auto merged
mysql-test/r/create.result
1.94 05/07/22 12:32:27 jimw@stripped +0 -0
Auto merged
# 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: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-clean/RESYNC
--- 1.244/sql/item_strfunc.cc 2005-07-19 10:42:24 -07:00
+++ 1.245/sql/item_strfunc.cc 2005-07-22 12:32:27 -07:00
@@ -2076,7 +2076,6 @@
{
ulonglong length= ((ulonglong) args[1]->val_int() *
collation.collation->mbmaxlen);
- length= max((ulonglong) args[0]->max_length, length);
if (length >= MAX_BLOB_WIDTH)
{
length= MAX_BLOB_WIDTH;
@@ -2164,7 +2163,6 @@
{
ulonglong length= ((ulonglong) args[1]->val_int() *
collation.collation->mbmaxlen);
- length= max((ulonglong) args[0]->max_length, length);
if (length >= MAX_BLOB_WIDTH)
{
length= MAX_BLOB_WIDTH;
--- 1.331/sql/mysql_priv.h 2005-07-20 22:29:53 -07:00
+++ 1.332/sql/mysql_priv.h 2005-07-22 12:35:11 -07:00
@@ -1245,10 +1245,13 @@
void unireg_init(ulong options);
void unireg_end(void);
bool mysql_create_frm(THD *thd, my_string file_name,
+ const char *table, const char* db,
HA_CREATE_INFO *create_info,
List<create_field> &create_field,
uint key_count,KEY *key_info,handler *db_type);
-int rea_create_table(THD *thd, my_string file_name,HA_CREATE_INFO *create_info,
+int rea_create_table(THD *thd, my_string file_name,
+ const char *table, const char* db,
+ HA_CREATE_INFO *create_info,
List<create_field> &create_field,
uint key_count,KEY *key_info);
int format_number(uint inputflag,uint max_length,my_string pos,uint length,
@@ -1315,7 +1318,8 @@
const char *newname);
ulong next_io_size(ulong pos);
void append_unescaped(String *res, const char *pos, uint length);
-int create_frm(THD *thd, char *name,uint reclength,uchar *fileinfo,
+int create_frm(THD *thd, char *name, const char *table, const char *db,
+ uint reclength,uchar *fileinfo,
HA_CREATE_INFO *create_info, uint keys);
void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form);
int rename_file_ext(const char * from,const char * to,const char * ext);
--- 1.263/sql/sql_table.cc 2005-07-20 22:29:53 -07:00
+++ 1.264/sql/sql_table.cc 2005-07-22 12:32:27 -07:00
@@ -1620,12 +1620,10 @@
create_info->data_file_name= create_info->index_file_name= 0;
create_info->table_options=db_options;
- if (rea_create_table(thd, path, create_info, fields, key_count,
+ if (rea_create_table(thd, path, table_name, db,
+ create_info, fields, key_count,
key_info_buffer))
- {
- /* my_error(ER_CANT_CREATE_TABLE,MYF(0),table_name,my_errno); */
goto end;
- }
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
/* Open table and put in temporary table list */
@@ -2660,8 +2658,14 @@
/*
Create a new table by copying from source table
*/
- if (my_copy(src_path, dst_path, MYF(MY_WME|MY_DONT_OVERWRITE_FILE)))
+ if (my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE)))
+ {
+ if (my_errno == ENOENT)
+ my_error(ER_BAD_DB_ERROR,MYF(0),db);
+ else
+ my_error(ER_CANT_CREATE_FILE,MYF(0),dst_path,my_errno);
goto err;
+ }
/*
As mysql_truncate don't work on a new table at this stage of
--- 1.172/sql/table.cc 2005-07-06 16:47:54 -07:00
+++ 1.173/sql/table.cc 2005-07-22 12:35:11 -07:00
@@ -1343,8 +1343,9 @@
/* Create a .frm file */
-File create_frm(THD *thd, register my_string name, uint reclength,
- uchar *fileinfo, HA_CREATE_INFO *create_info, uint keys)
+File create_frm(THD *thd, register my_string name, const char *table,
+ const char *db, uint reclength, uchar *fileinfo,
+ HA_CREATE_INFO *create_info, uint keys)
{
register File file;
ulong length;
@@ -1367,7 +1368,7 @@
*/
set_if_smaller(create_info->raid_chunks, 255);
- if ((file= my_create(name, CREATE_MODE, create_flags, MYF(MY_WME))) >= 0)
+ if ((file= my_create(name, CREATE_MODE, create_flags, MYF(0))) >= 0)
{
uint key_length, tmp_key_length;
uint tmp;
@@ -1413,6 +1414,13 @@
return(-1);
}
}
+ }
+ else
+ {
+ if (my_errno == ENOENT)
+ my_error(ER_BAD_DB_ERROR,MYF(0),db);
+ else
+ my_error(ER_CANT_CREATE_TABLE,MYF(0),table,my_errno);
}
return (file);
} /* create_frm */
--- 1.63/sql/unireg.cc 2005-06-17 14:14:29 -07:00
+++ 1.64/sql/unireg.cc 2005-07-22 12:35:11 -07:00
@@ -55,6 +55,8 @@
mysql_create_frm()
thd Thread handler
file_name Name of file (including database and .frm)
+ table Name of table
+ db Name of database
create_info create info parameters
create_fields Fields to create
keys number of keys to create
@@ -67,6 +69,7 @@
*/
bool mysql_create_frm(THD *thd, my_string file_name,
+ const char *table, const char *db,
HA_CREATE_INFO *create_info,
List<create_field> &create_fields,
uint keys, KEY *key_info,
@@ -113,7 +116,7 @@
}
reclength=uint2korr(forminfo+266);
- if ((file=create_frm(thd, file_name, reclength, fileinfo,
+ if ((file=create_frm(thd, file_name, table, db, reclength, fileinfo,
create_info, keys)) < 0)
{
my_free((gptr) screen_buff,MYF(0));
@@ -211,9 +214,11 @@
Create a frm (table definition) file and the tables
SYNOPSIS
- mysql_create_frm()
+ rea_create_table()
thd Thread handler
file_name Name of file (including database and .frm)
+ table Name of table
+ db Name of database
create_info create info parameters
create_fields Fields to create
keys number of keys to create
@@ -226,13 +231,14 @@
*/
int rea_create_table(THD *thd, my_string file_name,
+ const char *table, const char *db,
HA_CREATE_INFO *create_info,
List<create_field> &create_fields,
uint keys, KEY *key_info)
{
DBUG_ENTER("rea_create_table");
- if (mysql_create_frm(thd, file_name, create_info,
+ if (mysql_create_frm(thd, file_name, table, db, create_info,
create_fields, keys, key_info, NULL))
DBUG_RETURN(1);
if (!create_info->frm_only && ha_create_table(file_name,create_info,0))
--- 1.93/mysql-test/r/create.result 2005-06-09 09:01:24 -07:00
+++ 1.94/mysql-test/r/create.result 2005-07-22 12:32:27 -07:00
@@ -37,7 +37,7 @@
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
create table not_existing_database.test (a int);
-Got one of the listed errors
+ERROR 42000: Unknown database 'not_existing_database'
create table `a/a` (a int);
ERROR 42000: Incorrect table name 'a/a'
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
@@ -358,7 +358,7 @@
create table t3 like mysqltest.t3;
ERROR 42S01: Table 't3' already exists
create table non_existing_database.t1 like t1;
-Got one of the listed errors
+ERROR 42000: Unknown database 'non_existing_database'
create table t3 like non_existing_table;
ERROR 42S02: Unknown table 'non_existing_table'
create temporary table t3 like t1;
--- 1.55/mysql-test/t/create.test 2005-06-09 09:01:46 -07:00
+++ 1.56/mysql-test/t/create.test 2005-07-22 12:35:10 -07:00
@@ -39,7 +39,7 @@
--error 1075
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
--- error 1044,1
+-- error 1049
create table not_existing_database.test (a int);
--error 1103
create table `a/a` (a int);
@@ -305,7 +305,7 @@
create table t3 like t1;
--error 1050
create table t3 like mysqltest.t3;
---error ER_DBACCESS_DENIED_ERROR,1
+--error 1049
create table non_existing_database.t1 like t1;
--error 1051
create table t3 like non_existing_table;
--- 1.103/mysql-test/r/func_str.result 2005-07-13 02:36:14 -07:00
+++ 1.104/mysql-test/r/func_str.result 2005-07-22 12:32:27 -07:00
@@ -879,3 +879,18 @@
select hex(29223372036854775809), hex(-29223372036854775809);
hex(29223372036854775809) hex(-29223372036854775809)
FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF
+create table t1 (i int);
+insert into t1 values (1000000000),(1);
+select lpad(i, 7, ' ') as t from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def t 253 7 7 Y 128 31 63
+t
+1000000
+ 1
+select rpad(i, 7, ' ') as t from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def t 253 7 7 Y 128 31 63
+t
+1000000
+1
+drop table t1;
--- 1.77/mysql-test/t/func_str.test 2005-07-13 02:36:14 -07:00
+++ 1.78/mysql-test/t/func_str.test 2005-07-22 12:32:27 -07:00
@@ -613,3 +613,14 @@
# Bug #9854 hex() and out of range handling
#
select hex(29223372036854775809), hex(-29223372036854775809);
+
+#
+# Bug #11311: Incorrect length returned from LPAD() and RPAD()
+#
+create table t1 (i int);
+insert into t1 values (1000000000),(1);
+--enable_metadata
+select lpad(i, 7, ' ') as t from t1;
+select rpad(i, 7, ' ') as t from t1;
+--disable_metadata
+drop table t1;
| Thread |
|---|
| • bk commit into 5.0 tree (jimw:1.1891) | Jim Winstead | 22 Jul |