Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson 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.2300 05/06/16 15:17:47 msvensson@neptunus.(none) +3 -0
BUG10365 Cluster handler uses non-standard error code
- Updated after review
sql/sql_base.cc
1.250 05/06/16 15:17:44 msvensson@neptunus.(none) +1 -2
Only need to call ha_create_table_from_engine and check if result is > 0. If that
is the case, print error message
sql/handler.cc
1.166 05/06/16 15:17:44 msvensson@neptunus.(none) +10 -8
Return -1 if table does not exists
Return 0 if table exists and it could be created
Return >0 if table existed but it could not be created.
sql/ha_ndbcluster.cc
1.155 05/06/16 15:17:44 msvensson@neptunus.(none) +1 -1
Return -1 if table does not exists
# 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: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/bug10365
--- 1.165/sql/handler.cc 2005-06-08 13:31:56 +02:00
+++ 1.166/sql/handler.cc 2005-06-16 15:17:44 +02:00
@@ -1340,8 +1340,9 @@
if found, write the frm file to disk.
RETURN VALUES:
+ -1 : Table did not exists
0 : Table created ok
- 1 : Table could not be created
+ > 0 : Error, table existed but could not be created
*/
@@ -1361,10 +1362,10 @@
bzero((char*) &create_info,sizeof(create_info));
- if(ha_discover(thd, db, name, &frmblob, &frmlen))
+ if(error= ha_discover(thd, db, name, &frmblob, &frmlen))
{
// Table could not be discovered and thus not created
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
/*
@@ -1377,11 +1378,11 @@
if (writefrm(path, frmblob, frmlen))
{
my_free((char*) frmblob, MYF(MY_ALLOW_ZERO_PTR));
- DBUG_RETURN(1);
+ DBUG_RETURN(2);
}
if (openfrm(path,"",0,(uint) READ_ALL, 0, &table))
- DBUG_RETURN(1);
+ DBUG_RETURN(3);
update_create_info_from_table(&create_info, &table);
create_info.table_options|= HA_CREATE_FROM_ENGINE;
@@ -1506,14 +1507,15 @@
Try to discover one table from handler(s)
RETURN
- 0 ok. In this case *frmblob and *frmlen are set
- >=1 error. frmblob and frmlen may not be set
+ -1 : Table did not exists
+ 0 : OK. In this case *frmblob and *frmlen are set
+ >0 : error. frmblob and frmlen may not be set
*/
int ha_discover(THD *thd, const char *db, const char *name,
const void **frmblob, uint *frmlen)
{
- int error= 1; // Table does not exist in any handler
+ int error= -1; // Table does not exist in any handler
DBUG_ENTER("ha_discover");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
#ifdef HAVE_NDBCLUSTER_DB
--- 1.249/sql/sql_base.cc 2005-06-08 13:31:56 +02:00
+++ 1.250/sql/sql_base.cc 2005-06-16 15:17:44 +02:00
@@ -1376,8 +1376,7 @@
*/
if (discover_retry_count++ != 0)
goto err;
- if (ha_table_exists_in_engine(thd, db, name) &&
- ha_create_table_from_engine(thd, db, name))
+ if (ha_create_table_from_engine(thd, db, name) > 0)
{
/* Give right error message */
thd->clear_error();
--- 1.154/sql/ha_ndbcluster.cc 2005-06-08 13:31:56 +02:00
+++ 1.155/sql/ha_ndbcluster.cc 2005-06-16 15:17:44 +02:00
@@ -4300,7 +4300,7 @@
{
const NdbError err= dict->getNdbError();
if (err.code == 709)
- DBUG_RETURN(1);
+ DBUG_RETURN(-1);
ERR_RETURN(err);
}
DBUG_PRINT("info", ("Found table %s", tab->getName()));
| Thread |
|---|
| • bk commit into 4.1 tree (msvensson:1.2300) | msvensson | 16 Jun |