1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fixed prototype of get_error_message to use String to return error message

WL#1747 and #1746 allow user to decide if ordered index should be created or not


BitKeeper/deleted/.del-AttrType.hpp~a9b2d6efcf660378:
  Delete: ndb/include/ndbapi/AttrType.hpp
sql/ha_ndbcluster.cc:
  Removed the NDB_ERR_CODE_OFFSET, ndb and handler error codes should not clash
  Encapsulated functionality to cache information about known indexes into buil_index_list
  Added detection of algorithm from key_info in function get_index_type_from_table
  Updated read_range_first and records_in_range to work wih new prototype.
sql/ha_ndbcluster.h:
  WL#1746 and WL#1747 Added ability to skip creating an ordered index in addition to the hash index if the user so wishes.
  Modified get_error_message to return error messaga in a String datatype, in that way the String class will take care of wheter the "data" has to be freed or not.
sql/handler.cc:
  Use String datatype as ouput parameter of get_error_message.
sql/handler.h:
  Changed the function prototype for getting error messages from handler to use String datataype
This commit is contained in:
unknown
2004-05-24 12:35:39 +02:00
parent 4d3f8f210a
commit 88a3b3bca8
5 changed files with 124 additions and 488 deletions

View File

@@ -1123,14 +1123,15 @@ void handler::print_error(int error, myf errflag)
/* The error was "unknown" to this function.
Ask handler if it has got a message for this error */
bool temporary= FALSE;
const char* msg= get_error_message(&error, &temporary);
if (msg)
String str;
temporary= get_error_message(error, &str);
if (!str.is_empty())
{
const char* engine= ha_get_storage_engine(table->db_type);
if (temporary)
my_error(ER_GET_TEMPORARY_ERRMSG,MYF(0),error,msg,engine);
my_error(ER_GET_TEMPORARY_ERRMSG,MYF(0),error,str.ptr(),engine);
else
my_error(ER_GET_ERRMSG,MYF(0),error,msg,engine);
my_error(ER_GET_ERRMSG,MYF(0),error,str.ptr(),engine);
}
else
my_error(ER_GET_ERRNO,errflag,error);
@@ -1146,15 +1147,15 @@ void handler::print_error(int error, myf errflag)
Return an error message specific to this handler
SYNOPSIS
error [in/out] error code previously returned by handler
temporary [out] temporary error, transaction should be retried if true
error error code previously returned by handler
buf Pointer to String where to add error message
The returned pointer to error message should not be freed.
Returns true if this is a temporary error
*/
const char* handler::get_error_message(int *error, bool *temporary)
bool handler::get_error_message(int error, String* buf)
{
return NULL;
return false;
}