summaryrefslogtreecommitdiff
path: root/storage/federatedx
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2016-04-25 00:13:06 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2016-04-25 00:13:06 +0200
commit26adbb2dd50db0d62e6f7f5d12bdab0cd3a0bf31 (patch)
tree122b880f5f65cc094af71625266e70377c80eafc /storage/federatedx
parent8c9fd074d2269ccb0a1b18b9463e847a52b27fce (diff)
downloadmariadb-git-26adbb2dd50db0d62e6f7f5d12bdab0cd3a0bf31.tar.gz
- Fix an error causing MYSQL table to fail saying "no result set"
when joining a table to a MYSQL indexed table. modified: storage/connect/myconn.cpp modified: storage/connect/myconn.h modified: storage/connect/tabmysql.cpp - Add more tests to the mysql_index.test file modified: storage/connect/mysql-test/connect/r/mysql_index.result modified: storage/connect/mysql-test/connect/t/mysql_index.test - Fix and error causing remote indexing to fail when for not unique index. Was experienced with MYSQL, ODBC and JDBC tables. modified: storage/connect/connect.cc - Fix MDEV-9966 (zero lines returned) modified: storage/connect/ha_connect.cc modified: storage/federatedx/ha_federatedx.cc
Diffstat (limited to 'storage/federatedx')
-rw-r--r--storage/federatedx/ha_federatedx.cc26
1 files changed, 9 insertions, 17 deletions
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 70201167fde..dc524d3466a 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -566,17 +566,17 @@ int get_connection(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share)
at the address of the share.
*/
share->server_name_length= server->server_name_length;
- share->server_name= server->server_name;
- share->username= server->username;
- share->password= server->password;
- share->database= server->db;
+ share->server_name= const_cast<char*>(server->server_name);
+ share->username= const_cast<char*>(server->username);
+ share->password= const_cast<char*>(server->password);
+ share->database= const_cast<char*>(server->db);
share->port= server->port > MIN_PORT && server->port < 65536 ?
(ushort) server->port : MYSQL_PORT;
- share->hostname= server->host;
- if (!(share->socket= server->socket) &&
+ share->hostname= const_cast<char*>(server->host);
+ if (!(share->socket= const_cast<char*>(server->socket)) &&
!strcmp(share->hostname, my_localhost))
share->socket= (char *) MYSQL_UNIX_ADDR;
- share->scheme= server->scheme;
+ share->scheme= const_cast<char*>(server->scheme);
DBUG_PRINT("info", ("share->username: %s", share->username));
DBUG_PRINT("info", ("share->password: %s", share->password));
@@ -1319,7 +1319,7 @@ bool ha_federatedx::create_where_from_key(String *to,
break;
}
DBUG_PRINT("info", ("federatedx HA_READ_AFTER_KEY %d", i));
- if (store_length >= length) /* end key */
+ if (store_length >= length || i > 0) /* end key */
{
if (emit_key_part_name(&tmp, key_part))
goto err;
@@ -2555,9 +2555,7 @@ int ha_federatedx::index_read_idx(uchar *buf, uint index, const uchar *key,
RESULT
0 ok In this case *result will contain the result set
- table->status == 0
# error In this case *result will contain 0
- table->status == STATUS_NOT_FOUND
*/
int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index,
@@ -2614,11 +2612,9 @@ int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index,
insert_dynamic(&results, (uchar*) result);
*result= 0;
- table->status= STATUS_NOT_FOUND;
DBUG_RETURN(retval);
error:
- table->status= STATUS_NOT_FOUND;
my_error(retval, MYF(0), error_buffer);
DBUG_RETURN(retval);
}
@@ -2699,7 +2695,6 @@ int ha_federatedx::read_range_first(const key_range *start_key,
DBUG_RETURN(retval);
error:
- table->status= STATUS_NOT_FOUND;
DBUG_RETURN(retval);
}
@@ -2904,8 +2899,6 @@ int ha_federatedx::read_next(uchar *buf, FEDERATEDX_IO_RESULT *result)
FEDERATEDX_IO_ROW *row;
DBUG_ENTER("ha_federatedx::read_next");
- table->status= STATUS_NOT_FOUND; // For easier return
-
if ((retval= txn->acquire(share, TRUE, &io)))
DBUG_RETURN(retval);
@@ -2990,7 +2983,6 @@ int ha_federatedx::rnd_pos(uchar *buf, uchar *pos)
DBUG_RETURN(retval);
error:
- table->status= STATUS_NOT_FOUND;
DBUG_RETURN(retval);
}
@@ -3093,7 +3085,7 @@ error:
else if (remote_error_number != -1 /* error already reported */)
{
error_code= remote_error_number;
- my_error(error_code, MYF(0), ER(error_code));
+ my_error(error_code, MYF(0), ER_THD(thd, error_code));
}
fail:
tmp_txn->release(&tmp_io);