Commit 24c08f52 authored by Michael Widenius's avatar Michael Widenius

Fixed wrong error message from federatedx (which could lead to assert in DBUG code)

mysql-test/suite/federated/federated_server.result:
  Update to new error message
mysql-test/suite/federated/federated_server.test:
  Update to new error message
storage/federatedx/ha_federatedx.cc:
  Return real error code, not 0, as in some cases before.
parent 9f96097a
...@@ -213,7 +213,7 @@ id name ...@@ -213,7 +213,7 @@ id name
alter server s1 options (database 'db_bogus'); alter server s1 options (database 'db_bogus');
flush tables; flush tables;
select * from federated.t1; select * from federated.t1;
ERROR HY000: There was a problem processing the query on the foreign data source. Data source error: : 1044 : Access denied for user 'test_fed'@'localhost' to databa ERROR 42000: Got error: 1044 : Access denied for user 'test_fed'@'localhost' to database 'db_bogus'
drop server if exists 's1'; drop server if exists 's1';
ERROR 42000: Access denied; you need the SUPER privilege for this operation ERROR 42000: Access denied; you need the SUPER privilege for this operation
create server 's1' foreign data wrapper 'mysql' options create server 's1' foreign data wrapper 'mysql' options
......
...@@ -239,7 +239,7 @@ alter server s1 options (database 'db_bogus'); ...@@ -239,7 +239,7 @@ alter server s1 options (database 'db_bogus');
connection master; connection master;
flush tables; flush tables;
--error ER_QUERY_ON_FOREIGN_DATA_SOURCE --error ER_DBACCESS_DENIED_ERROR
select * from federated.t1; select * from federated.t1;
connection conn_select; connection conn_select;
......
...@@ -2995,7 +2995,6 @@ int ha_federatedx::rnd_pos(uchar *buf, uchar *pos) ...@@ -2995,7 +2995,6 @@ int ha_federatedx::rnd_pos(uchar *buf, uchar *pos)
int ha_federatedx::info(uint flag) int ha_federatedx::info(uint flag)
{ {
char error_buffer[FEDERATEDX_QUERY_BUFFER_SIZE];
uint error_code; uint error_code;
federatedx_io *tmp_io= 0, **iop= 0; federatedx_io *tmp_io= 0, **iop= 0;
DBUG_ENTER("ha_federatedx::info"); DBUG_ENTER("ha_federatedx::info");
...@@ -3037,12 +3036,10 @@ int ha_federatedx::info(uint flag) ...@@ -3037,12 +3036,10 @@ int ha_federatedx::info(uint flag)
error: error:
if (iop && *iop) if (iop && *iop)
{ {
my_sprintf(error_buffer, (error_buffer, ": %d : %s", my_printf_error((*iop)->error_code(), "Got error: %d : %s", MYF(0),
(*iop)->error_code(), (*iop)->error_str())); (*iop)->error_code(), (*iop)->error_str());
my_error(error_code, MYF(0), error_buffer);
} }
else else if (remote_error_number != -1 /* error already reported */)
if (remote_error_number != -1 /* error already reported */)
{ {
error_code= remote_error_number; error_code= remote_error_number;
my_error(error_code, MYF(0), ER(error_code)); my_error(error_code, MYF(0), ER(error_code));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment