summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Erickson <michae2@mariadb.com>2020-02-13 12:51:24 -0800
committerSergei Petrunia <psergey@askmonty.org>2020-03-10 11:22:33 +0300
commita24e184fa0a58d4ad1a2c20c60383011c70911d2 (patch)
treebcf2cdb600c44f403e43f1c0b0302e82081a1a83
parent0deb740c8a0e4bd65c7f686dc5615b35f7ab1401 (diff)
downloadmariadb-git-a24e184fa0a58d4ad1a2c20c60383011c70911d2.tar.gz
rebrand plugin from "clustrixdb" to "xpand"
-rw-r--r--mysql-test/suite/clustrixdb/suite.opt4
-rw-r--r--mysql-test/suite/xpand/basics.result (renamed from mysql-test/suite/clustrixdb/basics.result)22
-rw-r--r--mysql-test/suite/xpand/basics.test (renamed from mysql-test/suite/clustrixdb/basics.test)16
-rw-r--r--mysql-test/suite/xpand/my.cnf (renamed from mysql-test/suite/clustrixdb/my.cnf)0
-rw-r--r--mysql-test/suite/xpand/suite.opt4
-rw-r--r--mysql-test/suite/xpand/update.result (renamed from mysql-test/suite/clustrixdb/update.result)2
-rw-r--r--mysql-test/suite/xpand/update.test (renamed from mysql-test/suite/clustrixdb/update.test)2
-rw-r--r--mysql-test/suite/xpand/upsert.result (renamed from mysql-test/suite/clustrixdb/upsert.result)14
-rw-r--r--mysql-test/suite/xpand/upsert.test (renamed from mysql-test/suite/clustrixdb/upsert.test)2
-rw-r--r--storage/xpand/CMakeLists.txt (renamed from storage/clustrixdb/CMakeLists.txt)12
-rw-r--r--storage/xpand/ha_xpand.cc (renamed from storage/clustrixdb/ha_clustrixdb.cc)442
-rw-r--r--storage/xpand/ha_xpand.h (renamed from storage/clustrixdb/ha_clustrixdb.h)32
-rw-r--r--storage/xpand/ha_xpand_pushdown.cc (renamed from storage/clustrixdb/ha_clustrixdb_pushdown.cc)68
-rw-r--r--storage/xpand/ha_xpand_pushdown.h (renamed from storage/clustrixdb/ha_clustrixdb_pushdown.h)40
-rw-r--r--storage/xpand/xpand_connection.cc (renamed from storage/clustrixdb/clustrix_connection.cc)434
-rw-r--r--storage/xpand/xpand_connection.h (renamed from storage/clustrixdb/clustrix_connection.h)62
16 files changed, 578 insertions, 578 deletions
diff --git a/mysql-test/suite/clustrixdb/suite.opt b/mysql-test/suite/clustrixdb/suite.opt
deleted file mode 100644
index 481f692cfdd..00000000000
--- a/mysql-test/suite/clustrixdb/suite.opt
+++ /dev/null
@@ -1,4 +0,0 @@
---plugin-load=clustrixdb=ha_clustrixdb.so
---core-file
---clustrixdb_port=3306
---plugin-maturity=unknown
diff --git a/mysql-test/suite/clustrixdb/basics.result b/mysql-test/suite/xpand/basics.result
index 2af500cf9f1..07fb56dc072 100644
--- a/mysql-test/suite/clustrixdb/basics.result
+++ b/mysql-test/suite/xpand/basics.result
@@ -1,10 +1,10 @@
-CREATE DATABASE clx;
-USE clx;
+CREATE DATABASE xpd;
+USE xpd;
DROP TABLE IF EXISTS cx1;
Warnings:
-Note 1051 Unknown table 'clx.cx1'
-CREATE TABLE cx1(i BIGINT)ENGINE=clustrixdb;
-CREATE TABLE cx1(i BIGINT)ENGINE=clustrixdb;
+Note 1051 Unknown table 'xpd.cx1'
+CREATE TABLE cx1(i BIGINT)ENGINE=xpand;
+CREATE TABLE cx1(i BIGINT)ENGINE=xpand;
ERROR 42S01: Table 'cx1' already exists
INSERT INTO cx1 VALUES (42);
SELECT * FROM cx1;
@@ -12,11 +12,11 @@ i
42
DROP TABLE cx1;
SHOW CREATE TABLE cx1;
-ERROR 42S02: Table 'clx.cx1' doesn't exist
+ERROR 42S02: Table 'xpd.cx1' doesn't exist
DROP TABLE IF EXISTS intandtext;
Warnings:
-Note 1051 Unknown table 'clx.intandtext'
-CREATE TABLE intandtext(i bigint, t text)ENGINE=clustrixdb;
+Note 1051 Unknown table 'xpd.intandtext'
+CREATE TABLE intandtext(i bigint, t text)ENGINE=xpand;
INSERT INTO intandtext VALUES(10, 'someqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq');
SELECT i,t FROM intandtext;
i t
@@ -25,7 +25,7 @@ EXPLAIN SELECT i,t FROM intandtext;
id select_type table type possible_keys key key_len ref rows Extra
1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
SET @@optimizer_switch='derived_merge=OFF';
-SET clustrixdb_select_handler=OFF;
+SET xpand_select_handler=OFF;
SELECT i,t FROM (SELECT i,t FROM intandtext) t;
i t
10 someqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
@@ -33,7 +33,7 @@ EXPLAIN SELECT i,t FROM (SELECT i,t FROM intandtext) t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 10000
2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL
-SET clustrixdb_derived_handler=OFF;
+SET xpand_derived_handler=OFF;
SELECT i,t FROM intandtext;
i t
10 someqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
@@ -46,4 +46,4 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED intandtext ALL NULL NULL NULL NULL 10000
DROP TABLE intandtext;
USE test;
-DROP DATABASE clx;
+DROP DATABASE xpd;
diff --git a/mysql-test/suite/clustrixdb/basics.test b/mysql-test/suite/xpand/basics.test
index 81a81983bf3..0284086bfbd 100644
--- a/mysql-test/suite/clustrixdb/basics.test
+++ b/mysql-test/suite/xpand/basics.test
@@ -1,10 +1,10 @@
-CREATE DATABASE clx;
-USE clx;
+CREATE DATABASE xpd;
+USE xpd;
DROP TABLE IF EXISTS cx1;
-CREATE TABLE cx1(i BIGINT)ENGINE=clustrixdb;
+CREATE TABLE cx1(i BIGINT)ENGINE=xpand;
--error ER_TABLE_EXISTS_ERROR
-CREATE TABLE cx1(i BIGINT)ENGINE=clustrixdb;
+CREATE TABLE cx1(i BIGINT)ENGINE=xpand;
INSERT INTO cx1 VALUES (42);
@@ -16,18 +16,18 @@ DROP TABLE cx1;
SHOW CREATE TABLE cx1;
DROP TABLE IF EXISTS intandtext;
-CREATE TABLE intandtext(i bigint, t text)ENGINE=clustrixdb;
+CREATE TABLE intandtext(i bigint, t text)ENGINE=xpand;
INSERT INTO intandtext VALUES(10, 'someqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq');
SELECT i,t FROM intandtext;
EXPLAIN SELECT i,t FROM intandtext;
SET @@optimizer_switch='derived_merge=OFF';
-SET clustrixdb_select_handler=OFF;
+SET xpand_select_handler=OFF;
SELECT i,t FROM (SELECT i,t FROM intandtext) t;
EXPLAIN SELECT i,t FROM (SELECT i,t FROM intandtext) t;
-SET clustrixdb_derived_handler=OFF;
+SET xpand_derived_handler=OFF;
SELECT i,t FROM intandtext;
SELECT i,t FROM (SELECT i,t FROM intandtext) t;
EXPLAIN SELECT i,t FROM (SELECT i,t FROM intandtext) t;
@@ -35,4 +35,4 @@ EXPLAIN SELECT i,t FROM (SELECT i,t FROM intandtext) t;
DROP TABLE intandtext;
USE test;
-DROP DATABASE clx;
+DROP DATABASE xpd;
diff --git a/mysql-test/suite/clustrixdb/my.cnf b/mysql-test/suite/xpand/my.cnf
index 8105041b85c..8105041b85c 100644
--- a/mysql-test/suite/clustrixdb/my.cnf
+++ b/mysql-test/suite/xpand/my.cnf
diff --git a/mysql-test/suite/xpand/suite.opt b/mysql-test/suite/xpand/suite.opt
new file mode 100644
index 00000000000..1e15cb158ae
--- /dev/null
+++ b/mysql-test/suite/xpand/suite.opt
@@ -0,0 +1,4 @@
+--plugin-load=xpand=ha_xpand.so
+--core-file
+--xpand_port=3306
+--plugin-maturity=unknown
diff --git a/mysql-test/suite/clustrixdb/update.result b/mysql-test/suite/xpand/update.result
index fec6a409a7b..9b39f318ca1 100644
--- a/mysql-test/suite/clustrixdb/update.result
+++ b/mysql-test/suite/xpand/update.result
@@ -3,7 +3,7 @@ USE `db1`;
DROP TABLE IF EXISTS `t1`;
Warnings:
Note 1051 Unknown table 'db1.t1'
-CREATE TABLE `t1`(i BIGINT, t TEXT)ENGINE=clustrixdb;
+CREATE TABLE `t1`(i BIGINT, t TEXT)ENGINE=xpand;
INSERT INTO `t1` (i, t) VALUES (42, 'один');
INSERT INTO `t1` (i, t) VALUES (42, 'ноль');
SELECT * FROM `t1` ORDER BY `i` DESC, `t` DESC;
diff --git a/mysql-test/suite/clustrixdb/update.test b/mysql-test/suite/xpand/update.test
index 599d7f348ac..eb40a19d7ac 100644
--- a/mysql-test/suite/clustrixdb/update.test
+++ b/mysql-test/suite/xpand/update.test
@@ -1,7 +1,7 @@
CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;
DROP TABLE IF EXISTS `t1`;
-CREATE TABLE `t1`(i BIGINT, t TEXT)ENGINE=clustrixdb;
+CREATE TABLE `t1`(i BIGINT, t TEXT)ENGINE=xpand;
INSERT INTO `t1` (i, t) VALUES (42, 'один');
INSERT INTO `t1` (i, t) VALUES (42, 'ноль');
SELECT * FROM `t1` ORDER BY `i` DESC, `t` DESC;
diff --git a/mysql-test/suite/clustrixdb/upsert.result b/mysql-test/suite/xpand/upsert.result
index f30cfe95314..13c948c0a60 100644
--- a/mysql-test/suite/clustrixdb/upsert.result
+++ b/mysql-test/suite/xpand/upsert.result
@@ -3,7 +3,7 @@ USE `db1`;
DROP TABLE IF EXISTS `ins_duplicate`;
Warnings:
Note 1051 Unknown table 'db1.ins_duplicate'
-CREATE TABLE `ins_duplicate`(`id` INT PRIMARY KEY, `animal` VARCHAR(30)) ENGINE=clustrixdb;
+CREATE TABLE `ins_duplicate`(`id` INT PRIMARY KEY, `animal` VARCHAR(30)) ENGINE=xpand;
INSERT INTO `ins_duplicate` VALUES (1,'Aardvark'), (2,'Cheetah'), (3,'Zebra');
SELECT * FROM `ins_duplicate` ORDER BY `id`;
id animal
@@ -11,7 +11,7 @@ id animal
2 Cheetah
3 Zebra
INSERT INTO ins_duplicate VALUES (1,'Antelope');
-ERROR 23000: Clustrix error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
+ERROR 23000: Xpand error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
INSERT INTO ins_duplicate VALUES (1,'Antelope') ON DUPLICATE KEY UPDATE animal='Banana';
SELECT * FROM `ins_duplicate` ORDER BY `id`;
id animal
@@ -19,7 +19,7 @@ id animal
2 Cheetah
3 Zebra
INSERT INTO ins_duplicate VALUES (1,'Antelope'),(2,'Cheetah');
-ERROR 23000: Clustrix error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
+ERROR 23000: Xpand error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
INSERT INTO ins_duplicate VALUES (1,'Antelope'),(2,'Cheetah') ON DUPLICATE KEY UPDATE animal='hybrid';
SELECT * FROM `ins_duplicate` ORDER BY `id`;
id animal
@@ -33,7 +33,7 @@ id animal
2 hybrid
3 Zebra
INSERT INTO ins_duplicate VALUES (1,'Antelope');
-ERROR 23000: Clustrix error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
+ERROR 23000: Xpand error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
INSERT INTO ins_duplicate VALUES (1,'Antelope') ON DUPLICATE KEY UPDATE animal='Vegetable';
SELECT * FROM `ins_duplicate` ORDER BY `id`;
id animal
@@ -41,7 +41,7 @@ id animal
2 hybrid
3 Zebra
INSERT INTO ins_duplicate VALUES (1,'Antelope'),(2,'Cheetah');
-ERROR 23000: Clustrix error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
+ERROR 23000: Xpand error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
INSERT INTO ins_duplicate VALUES (1,'Antelope'),(2,'Cheetah') ON DUPLICATE KEY UPDATE animal='hybrid2';
COMMIT;
BEGIN;
@@ -51,7 +51,7 @@ id animal
2 hybrid2
3 Zebra
INSERT INTO ins_duplicate VALUES (1,'Antelope');
-ERROR 23000: Clustrix error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
+ERROR 23000: Xpand error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
INSERT INTO ins_duplicate VALUES (1,'Antelope') ON DUPLICATE KEY UPDATE animal='Vegetable';
SELECT * FROM `ins_duplicate` ORDER BY `id`;
id animal
@@ -59,7 +59,7 @@ id animal
2 hybrid2
3 Zebra
INSERT INTO ins_duplicate VALUES (1,'Antelope'),(2,'Cheetah');
-ERROR 23000: Clustrix error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
+ERROR 23000: Xpand error: [5120] Duplicate key in container: `db1`.`ins_duplicate` Primary key: (1)
INSERT INTO ins_duplicate VALUES (1,'Antelope'),(2,'Cheetah') ON DUPLICATE KEY UPDATE animal='hybrid3';
ROLLBACK;
SELECT * FROM `ins_duplicate` ORDER BY `id`;
diff --git a/mysql-test/suite/clustrixdb/upsert.test b/mysql-test/suite/xpand/upsert.test
index badd6cb50d4..7763cb27d61 100644
--- a/mysql-test/suite/clustrixdb/upsert.test
+++ b/mysql-test/suite/xpand/upsert.test
@@ -1,7 +1,7 @@
CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;
DROP TABLE IF EXISTS `ins_duplicate`;
-CREATE TABLE `ins_duplicate`(`id` INT PRIMARY KEY, `animal` VARCHAR(30)) ENGINE=clustrixdb;
+CREATE TABLE `ins_duplicate`(`id` INT PRIMARY KEY, `animal` VARCHAR(30)) ENGINE=xpand;
INSERT INTO `ins_duplicate` VALUES (1,'Aardvark'), (2,'Cheetah'), (3,'Zebra');
SELECT * FROM `ins_duplicate` ORDER BY `id`;
diff --git a/storage/clustrixdb/CMakeLists.txt b/storage/xpand/CMakeLists.txt
index 42237eae6e9..78fe16c0525 100644
--- a/storage/clustrixdb/CMakeLists.txt
+++ b/storage/xpand/CMakeLists.txt
@@ -9,16 +9,16 @@ IF(MSVC)
ENDIF()
ENDIF()
-SET(CLUSTRIXDB_PLUGIN_STATIC "clustrixdb")
-SET(CLUSTRIXDB_PLUGIN_DYNAMIC "ha_clustrixdb")
-SET(CLUSTRIXDB_SOURCES ha_clustrixdb.cc clustrix_connection.cc ha_clustrixdb_pushdown.cc)
-MYSQL_ADD_PLUGIN(clustrixdb ${CLUSTRIXDB_SOURCES} STORAGE_ENGINE)
+SET(XPAND_PLUGIN_STATIC "xpand")
+SET(XPAND_PLUGIN_DYNAMIC "ha_xpand")
+SET(XPAND_SOURCES ha_xpand.cc xpand_connection.cc ha_xpand_pushdown.cc)
+MYSQL_ADD_PLUGIN(xpand ${XPAND_SOURCES} STORAGE_ENGINE)
IF(MSVC)
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
- ADD_CUSTOM_COMMAND(TARGET clustrixdb
+ ADD_CUSTOM_COMMAND(TARGET xpand
POST_BUILD
COMMAND if not exist ..\\..\\sql\\lib mkdir ..\\..\\sql\\lib\\plugin
- COMMAND copy Debug\\ha_clustrixdb.dll ..\\..\\sql\\lib\\plugin\\ha_clustrixdb.dll)
+ COMMAND copy Debug\\ha_xpand.dll ..\\..\\sql\\lib\\plugin\\ha_xpand.dll)
ENDIF()
ENDIF()
diff --git a/storage/clustrixdb/ha_clustrixdb.cc b/storage/xpand/ha_xpand.cc
index d80ab91653b..8a8366fa9f7 100644
--- a/storage/clustrixdb/ha_clustrixdb.cc
+++ b/storage/xpand/ha_xpand.cc
@@ -2,51 +2,51 @@
Copyright (c) 2019, MariaDB Corporation.
*****************************************************************************/
-/** @file ha_clustrixdb.cc */
+/** @file ha_xpand.cc */
-#include "ha_clustrixdb.h"
-#include "ha_clustrixdb_pushdown.h"
+#include "ha_xpand.h"
+#include "ha_xpand_pushdown.h"
#include "key.h"
-handlerton *clustrixdb_hton = NULL;
+handlerton *xpand_hton = NULL;
-int clustrix_connect_timeout;
+int xpand_connect_timeout;
static MYSQL_SYSVAR_INT
(
connect_timeout,
- clustrix_connect_timeout,
+ xpand_connect_timeout,
PLUGIN_VAR_OPCMDARG,
- "Timeout for connecting to Clustrix",
+ "Timeout for connecting to Xpand",
NULL, NULL, -1, -1, 2147483647, 0
);
-int clustrix_read_timeout;
+int xpand_read_timeout;
static MYSQL_SYSVAR_INT
(
read_timeout,
- clustrix_read_timeout,
+ xpand_read_timeout,
PLUGIN_VAR_OPCMDARG,
- "Timeout for receiving data from Clustrix",
+ "Timeout for receiving data from Xpand",
NULL, NULL, -1, -1, 2147483647, 0
);
-int clustrix_write_timeout;
+int xpand_write_timeout;
static MYSQL_SYSVAR_INT
(
write_timeout,
- clustrix_write_timeout,
+ xpand_write_timeout,
PLUGIN_VAR_OPCMDARG,
- "Timeout for sending data to Clustrix",
+ "Timeout for sending data to Xpand",
NULL, NULL, -1, -1, 2147483647, 0
);
-char *clustrix_host;
+char *xpand_host;
static MYSQL_SYSVAR_STR
(
host,
- clustrix_host,
+ xpand_host,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC,
- "Clustrix host",
+ "Xpand host",
NULL, NULL, "127.0.0.1"
);
@@ -63,12 +63,12 @@ static void free_host_list()
}
}
-static void update_host_list(char *clustrix_host)
+static void update_host_list(char *xpand_host)
{
free_host_list();
int cnt = 0;
- for (char *p = clustrix_host, *s = clustrix_host; ; p++) {
+ for (char *p = xpand_host, *s = xpand_host; ; p++) {
if (*p == ',' || *p == '\0') {
if (p > s) {
cnt++;
@@ -85,7 +85,7 @@ static void update_host_list(char *clustrix_host)
host_list_cnt = cnt;
int i = 0;
- for (char *p = clustrix_host, *s = clustrix_host; ; p++) {
+ for (char *p = xpand_host, *s = xpand_host; ; p++) {
if (*p == ',' || *p == '\0') {
if (p > s) {
char *host = (char *)my_malloc(p - s + 1, MYF(MY_WME));
@@ -100,46 +100,46 @@ static void update_host_list(char *clustrix_host)
}
}
- DBUG_PRINT("clustrix_host", ("%s", clustrix_host));
+ DBUG_PRINT("xpand_host", ("%s", xpand_host));
}
-char *clustrix_username;
+char *xpand_username;
static MYSQL_SYSVAR_STR
(
username,
- clustrix_username,
+ xpand_username,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC,
- "Clustrix user name",
+ "Xpand user name",
NULL, NULL, "root"
);
-char *clustrix_password;
+char *xpand_password;
static MYSQL_SYSVAR_STR
(
password,
- clustrix_password,
+ xpand_password,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC,
- "Clustrix password",
+ "Xpand password",
NULL, NULL, ""
);
-uint clustrix_port;
+uint xpand_port;
static MYSQL_SYSVAR_UINT
(
port,
- clustrix_port,
+ xpand_port,
PLUGIN_VAR_RQCMDARG,
- "Clustrix port",
+ "Xpand port",
NULL, NULL, MYSQL_PORT_DEFAULT, MYSQL_PORT_DEFAULT, 65535, 0
);
-char *clustrix_socket;
+char *xpand_socket;
static MYSQL_SYSVAR_STR
(
socket,
- clustrix_socket,
+ xpand_socket,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC,
- "Clustrix socket",
+ "Xpand socket",
NULL, NULL, ""
);
@@ -147,7 +147,7 @@ static MYSQL_THDVAR_UINT
(
row_buffer,
PLUGIN_VAR_RQCMDARG,
- "Clustrix rowstore row buffer size",
+ "Xpand rowstore row buffer size",
NULL, NULL, 20, 1, 65535, 0
);
@@ -247,13 +247,13 @@ static void decode_file_path(const char *path, char *decoded_dbname,
decode_objectname(decoded_tbname, tbname_start, FN_REFLEN);
}
-clustrix_connection *get_trx(THD *thd, int *error_code)
+xpand_connection *get_trx(THD *thd, int *error_code)
{
*error_code = 0;
- clustrix_connection *trx;
- if (!(trx = (clustrix_connection *)thd_get_ha_data(thd, clustrixdb_hton)))
+ xpand_connection *trx;
+ if (!(trx = (xpand_connection *)thd_get_ha_data(thd, xpand_hton)))
{
- if (!(trx = new clustrix_connection())) {
+ if (!(trx = new xpand_connection())) {
*error_code = HA_ERR_OUT_OF_MEM;
return NULL;
}
@@ -264,37 +264,37 @@ clustrix_connection *get_trx(THD *thd, int *error_code)
return NULL;
}
- thd_set_ha_data(thd, clustrixdb_hton, trx);
+ thd_set_ha_data(thd, xpand_hton, trx);
}
return trx;
}
/****************************************************************************
-** Class ha_clustrixdb
+** Class ha_xpand
****************************************************************************/
-ha_clustrixdb::ha_clustrixdb(handlerton *hton, TABLE_SHARE *table_arg)
+ha_xpand::ha_xpand(handlerton *hton, TABLE_SHARE *table_arg)
: handler(hton, table_arg)
{
- DBUG_ENTER("ha_clustrixdb::ha_clustrixdb");
+ DBUG_ENTER("ha_xpand::ha_xpand");
rgi = NULL;
scan_cur = NULL;
- clustrix_table_oid = 0;
+ xpand_table_oid = 0;
upsert_flag = 0;
DBUG_VOID_RETURN;
}
-ha_clustrixdb::~ha_clustrixdb()
+ha_xpand::~ha_xpand()
{
if (rgi)
remove_current_table_from_rpl_table_list(rgi);
}
-int ha_clustrixdb::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
+int ha_xpand::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
{
int error_code;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -324,7 +324,7 @@ int ha_clustrixdb::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
if (error_code)
return error_code;
- // To syncronize the schemas of MDB FE and CLX BE.
+ // To syncronize the schemas of MDB FE and XPD BE.
if (form->s && form->s->db.length) {
String createdb_stmt;
createdb_stmt.append("CREATE DATABASE IF NOT EXISTS `");
@@ -337,11 +337,11 @@ int ha_clustrixdb::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
return error_code;
}
-int ha_clustrixdb::delete_table(const char *path)
+int ha_xpand::delete_table(const char *path)
{
int error_code;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -359,11 +359,11 @@ int ha_clustrixdb::delete_table(const char *path)
return trx->run_query(delete_cmd);
}
-int ha_clustrixdb::rename_table(const char* from, const char* to)
+int ha_xpand::rename_table(const char* from, const char* to)
{
int error_code;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -390,23 +390,23 @@ int ha_clustrixdb::rename_table(const char* from, const char* to)
}
static void
-clustrixdb_mark_table_for_discovery(TABLE *table)
+xpand_mark_table_for_discovery(TABLE *table)
{
table->s->tabledef_version.str = NULL;
table->s->tabledef_version.length = 0;
table->m_needs_reopen = TRUE;
}
-int ha_clustrixdb::open(const char *name, int mode, uint test_if_locked)
+int ha_xpand::open(const char *name, int mode, uint test_if_locked)
{
- DBUG_ENTER("ha_clustrixdb::open");
+ DBUG_ENTER("ha_xpand::open");
DBUG_PRINT("oid",
("%s", table->s->tabledef_version.str));
if (!table->s->tabledef_version.str)
DBUG_RETURN(HA_ERR_TABLE_DEF_CHANGED);
- if (!clustrix_table_oid)
- clustrix_table_oid = atoll((const char *)table->s->tabledef_version.str);
+ if (!xpand_table_oid)
+ xpand_table_oid = atoll((const char *)table->s->tabledef_version.str);
// Surrogate key marker
has_hidden_key = table->s->primary_key == MAX_KEY;
@@ -418,53 +418,53 @@ int ha_clustrixdb::open(const char *name, int mode, uint test_if_locked)
}
DBUG_PRINT("open finished",
- ("oid: %llu, ref_length: %u", clustrix_table_oid, ref_length));
+ ("oid: %llu, ref_length: %u", xpand_table_oid, ref_length));
DBUG_RETURN(0);
}
-int ha_clustrixdb::close(void)
+int ha_xpand::close(void)
{
return 0;
}
-int ha_clustrixdb::reset()
+int ha_xpand::reset()
{
- upsert_flag &= ~CLUSTRIX_BULK_UPSERT;
- upsert_flag &= ~CLUSTRIX_HAS_UPSERT;
- upsert_flag &= ~CLUSTRIX_UPSERT_SENT;
- clx_lock_type = CLUSTRIX_NO_LOCKS;
+ upsert_flag &= ~XPAND_BULK_UPSERT;
+ upsert_flag &= ~XPAND_HAS_UPSERT;
+ upsert_flag &= ~XPAND_UPSERT_SENT;
+ xpd_lock_type = XPAND_NO_LOCKS;
return 0;
}
-int ha_clustrixdb::extra(enum ha_extra_function operation)
+int ha_xpand::extra(enum ha_extra_function operation)
{
- DBUG_ENTER("ha_clustrixdb::extra");
+ DBUG_ENTER("ha_xpand::extra");
if (operation == HA_EXTRA_INSERT_WITH_UPDATE)
- upsert_flag |= CLUSTRIX_HAS_UPSERT;
+ upsert_flag |= XPAND_HAS_UPSERT;
DBUG_RETURN(0);
}
/*@brief UPSERT State Machine*/
/*************************************************************
* DESCRIPTION:
- * Fasttrack for UPSERT sends queries down to a CLX backend.
+ * Fasttrack for UPSERT sends queries down to a XPD backend.
* UPSERT could be of two kinds: singular and bulk. The plugin
- * re-/sets CLUSTRIX_BULK_UPSERT in end|start_bulk_insert
- * methods. CLUSTRIX_UPSERT_SENT is used to avoid multiple
- * execution at CLX backend.
- * Generic CLUSTRIX_HAS_UPSERT is set for bulk UPSERT only b/c
+ * re-/sets XPAND_BULK_UPSERT in end|start_bulk_insert
+ * methods. XPAND_UPSERT_SENT is used to avoid multiple
+ * execution at XPD backend.
+ * Generic XPAND_HAS_UPSERT is set for bulk UPSERT only b/c
* MDB calls write_row only once.
************************************************************/
-int ha_clustrixdb::write_row(const uchar *buf)
+int ha_xpand::write_row(const uchar *buf)
{
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
- if (upsert_flag & CLUSTRIX_HAS_UPSERT) {
- if (!(upsert_flag & CLUSTRIX_UPSERT_SENT)) {
+ if (upsert_flag & XPAND_HAS_UPSERT) {
+ if (!(upsert_flag & XPAND_UPSERT_SENT)) {
ha_rows update_rows;
String update_stmt;
update_stmt.append(thd->query_string.str());
@@ -473,10 +473,10 @@ int ha_clustrixdb::write_row(const uchar *buf)
trx->auto_commit_next();
error_code= trx->update_query(update_stmt, table->s->db, &update_rows);
- if (upsert_flag & CLUSTRIX_BULK_UPSERT)
- upsert_flag |= CLUSTRIX_UPSERT_SENT;
+ if (upsert_flag & XPAND_BULK_UPSERT)
+ upsert_flag |= XPAND_UPSERT_SENT;
else
- upsert_flag &= ~CLUSTRIX_HAS_UPSERT;
+ upsert_flag &= ~XPAND_HAS_UPSERT;
}
return error_code;
@@ -486,10 +486,10 @@ int ha_clustrixdb::write_row(const uchar *buf)
uchar *packed_new_row = (uchar*) my_alloca(estimate_row_size(table));
size_t packed_size = pack_row(table, table->write_set, packed_new_row, buf);
- /* XXX: Clustrix may needs to return HA_ERR_AUTOINC_ERANGE if we hit that
+ /* XXX: Xpand may needs to return HA_ERR_AUTOINC_ERANGE if we hit that
error. */
ulonglong last_insert_id = 0;
- if ((error_code = trx->write_row(clustrix_table_oid,
+ if ((error_code = trx->write_row(xpand_table_oid,
packed_new_row, packed_size,
&last_insert_id)))
goto err;
@@ -499,7 +499,7 @@ int ha_clustrixdb::write_row(const uchar *buf)
err:
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
if (packed_size)
my_afree(packed_new_row);
@@ -507,12 +507,12 @@ err:
return error_code;
}
-int ha_clustrixdb::update_row(const uchar *old_data, const uchar *new_data)
+int ha_xpand::update_row(const uchar *old_data, const uchar *new_data)
{
- DBUG_ENTER("ha_clustrixdb::update_row");
+ DBUG_ENTER("ha_xpand::update_row");
int error_code;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
@@ -526,8 +526,8 @@ int ha_clustrixdb::update_row(const uchar *old_data, const uchar *new_data)
size_t packed_new_size = pack_row(table, table->write_set, packed_new_row,
new_data);
- /* Send the packed rows to Clustrix */
- error_code = trx->key_update(clustrix_table_oid, packed_key, packed_key_len,
+ /* Send the packed rows to Xpand */
+ error_code = trx->key_update(xpand_table_oid, packed_key, packed_key_len,
table->write_set,
packed_new_row, packed_new_size);
@@ -538,26 +538,26 @@ int ha_clustrixdb::update_row(const uchar *old_data, const uchar *new_data)
my_afree(packed_new_row);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
DBUG_RETURN(error_code);
}
-int ha_clustrixdb::direct_update_rows_init(List<Item> *update_fields)
+int ha_xpand::direct_update_rows_init(List<Item> *update_fields)
{
- DBUG_ENTER("ha_clustrixdb::direct_update_rows_init");
+ DBUG_ENTER("ha_xpand::direct_update_rows_init");
THD *thd= ha_thd();
if (!THDVAR(thd, enable_direct_update))
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
DBUG_RETURN(0);
}
-int ha_clustrixdb::direct_update_rows(ha_rows *update_rows, ha_rows *found_rows)
+int ha_xpand::direct_update_rows(ha_rows *update_rows, ha_rows *found_rows)
{
- DBUG_ENTER("ha_clustrixdb::direct_update_rows");
+ DBUG_ENTER("ha_xpand::direct_update_rows");
int error_code= 0;
THD *thd= ha_thd();
- clustrix_connection *trx= get_trx(thd, &error_code);
+ xpand_connection *trx= get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -572,36 +572,36 @@ int ha_clustrixdb::direct_update_rows(ha_rows *update_rows, ha_rows *found_rows)
DBUG_RETURN(error_code);
}
-void ha_clustrixdb::start_bulk_insert(ha_rows rows, uint flags)
+void ha_xpand::start_bulk_insert(ha_rows rows, uint flags)
{
- DBUG_ENTER("ha_clustrixdb::start_bulk_insert");
+ DBUG_ENTER("ha_xpand::start_bulk_insert");
int error_code= 0;
THD *thd= ha_thd();
- clustrix_connection *trx= get_trx(thd, &error_code);
+ xpand_connection *trx= get_trx(thd, &error_code);
if (!trx) {
// TBD log this
DBUG_VOID_RETURN;
}
- upsert_flag |= CLUSTRIX_BULK_UPSERT;
+ upsert_flag |= XPAND_BULK_UPSERT;
DBUG_VOID_RETURN;
}
-int ha_clustrixdb::end_bulk_insert()
+int ha_xpand::end_bulk_insert()
{
- DBUG_ENTER("ha_clustrixdb::end_bulk_insert");
- upsert_flag &= ~CLUSTRIX_BULK_UPSERT;
- upsert_flag &= ~CLUSTRIX_HAS_UPSERT;
- upsert_flag &= ~CLUSTRIX_UPSERT_SENT;
+ DBUG_ENTER("ha_xpand::end_bulk_insert");
+ upsert_flag &= ~XPAND_BULK_UPSERT;
+ upsert_flag &= ~XPAND_HAS_UPSERT;
+ upsert_flag &= ~XPAND_UPSERT_SENT;
DBUG_RETURN(0);
}
-int ha_clustrixdb::delete_row(const uchar *buf)
+int ha_xpand::delete_row(const uchar *buf)
{
int error_code;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -610,10 +610,10 @@ int ha_clustrixdb::delete_row(const uchar *buf)
uchar *packed_key = (uchar*) my_alloca(estimate_row_size(table));
build_key_packed_row(table->s->primary_key, buf, packed_key, &packed_key_len);
- error_code = trx->key_delete(clustrix_table_oid, packed_key, packed_key_len);
+ error_code = trx->key_delete(xpand_table_oid, packed_key, packed_key_len);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
if (packed_key)
my_afree(packed_key);
@@ -621,7 +621,7 @@ int ha_clustrixdb::delete_row(const uchar *buf)
return error_code;
}
-ha_clustrixdb::Table_flags ha_clustrixdb::table_flags(void) const
+ha_xpand::Table_flags ha_xpand::table_flags(void) const
{
Table_flags flags = HA_PARTIAL_COLUMN_READ |
HA_REC_NOT_IN_SEQ |
@@ -637,7 +637,7 @@ ha_clustrixdb::Table_flags ha_clustrixdb::table_flags(void) const
return flags;
}
-ulong ha_clustrixdb::index_flags(uint idx, uint part, bool all_parts) const
+ulong ha_xpand::index_flags(uint idx, uint part, bool all_parts) const
{
ulong flags = HA_READ_NEXT |
HA_READ_PREV |
@@ -647,18 +647,18 @@ ulong ha_clustrixdb::index_flags(uint idx, uint part, bool all_parts) const
return flags;
}
-ha_rows ha_clustrixdb::records()
+ha_rows ha_xpand::records()
{
return 10000;
}
-ha_rows ha_clustrixdb::records_in_range(uint inx, key_range *min_key,
+ha_rows ha_xpand::records_in_range(uint inx, key_range *min_key,
key_range *max_key)
{
return 2;
}
-int ha_clustrixdb::info(uint flag)
+int ha_xpand::info(uint flag)
{
//THD *thd = ha_thd();
if (flag & HA_STATUS_TIME)
@@ -705,11 +705,11 @@ int ha_clustrixdb::info(uint flag)
return 0;
}
-int ha_clustrixdb::index_init(uint idx, bool sorted)
+int ha_xpand::index_init(uint idx, bool sorted)
{
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -727,13 +727,13 @@ int ha_clustrixdb::index_init(uint idx, bool sorted)
return 0;
}
-int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
+int ha_xpand::index_read(uchar * buf, const uchar * key, uint key_len,
enum ha_rkey_function find_flag)
{
- DBUG_ENTER("ha_clustrixdb::index_read");
+ DBUG_ENTER("ha_xpand::index_read");
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
@@ -744,22 +744,22 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
build_key_packed_row(active_index, buf, packed_key, &packed_key_len);
bool exact = false;
- clustrix_connection::scan_type st;
+ xpand_connection::scan_type st;
switch (find_flag) {
case HA_READ_KEY_EXACT:
exact = true;
break;
case HA_READ_KEY_OR_NEXT:
- st = clustrix_connection::READ_KEY_OR_NEXT;
+ st = xpand_connection::READ_KEY_OR_NEXT;
break;
case HA_READ_KEY_OR_PREV:
- st = clustrix_connection::READ_KEY_OR_PREV;
+ st = xpand_connection::READ_KEY_OR_PREV;
break;
case HA_READ_AFTER_KEY:
- st = clustrix_connection::READ_AFTER_KEY;
+ st = xpand_connection::READ_AFTER_KEY;
break;
case HA_READ_BEFORE_KEY:
- st = clustrix_connection::READ_BEFORE_KEY;
+ st = xpand_connection::READ_BEFORE_KEY;
break;
case HA_READ_PREFIX:
case HA_READ_PREFIX_LAST:
@@ -776,7 +776,7 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
if (exact) {
is_scan = false;
ulong rowdata_length;
- error_code = trx->key_read(clustrix_table_oid, 0, clx_lock_type,
+ error_code = trx->key_read(xpand_table_oid, 0, xpd_lock_type,
table->read_set, packed_key, packed_key_len,
&rowdata, &rowdata_length);
if (!error_code)
@@ -785,8 +785,8 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
rowdata + rowdata_length);
} else {
is_scan = true;
- error_code = trx->scan_from_key(clustrix_table_oid, active_index,
- clx_lock_type, st, -1, sorted_scan,
+ error_code = trx->scan_from_key(xpand_table_oid, active_index,
+ xpd_lock_type, st, -1, sorted_scan,
&scan_fields, packed_key, packed_key_len,
THDVAR(thd, row_buffer), &scan_cur);
if (!error_code)
@@ -800,28 +800,28 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
my_afree(packed_key);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
DBUG_RETURN(error_code);
}
-int ha_clustrixdb::index_first(uchar *buf)
+int ha_xpand::index_first(uchar *buf)
{
- DBUG_ENTER("ha_clustrixdb::index_first");
+ DBUG_ENTER("ha_xpand::index_first");
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
- error_code = trx->scan_from_key(clustrix_table_oid, active_index,
- clx_lock_type,
- clustrix_connection::READ_FROM_START,
+ error_code = trx->scan_from_key(xpand_table_oid, active_index,
+ xpd_lock_type,
+ xpand_connection::READ_FROM_START,
-1, sorted_scan, &scan_fields, NULL, 0,
THDVAR(thd, row_buffer), &scan_cur);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
if (error_code)
DBUG_RETURN(error_code);
@@ -829,23 +829,23 @@ int ha_clustrixdb::index_first(uchar *buf)
DBUG_RETURN(rnd_next(buf));
}
-int ha_clustrixdb::index_last(uchar *buf)
+int ha_xpand::index_last(uchar *buf)
{
- DBUG_ENTER("ha_clustrixdb::index_last");
+ DBUG_ENTER("ha_xpand::index_last");
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
- error_code = trx->scan_from_key(clustrix_table_oid, active_index,
- clx_lock_type,
- clustrix_connection::READ_FROM_LAST,
+ error_code = trx->scan_from_key(xpand_table_oid, active_index,
+ xpd_lock_type,
+ xpand_connection::READ_FROM_LAST,
-1, sorted_scan, &scan_fields, NULL, 0,
THDVAR(thd, row_buffer), &scan_cur);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
if (error_code)
DBUG_RETURN(error_code);
@@ -853,27 +853,27 @@ int ha_clustrixdb::index_last(uchar *buf)
DBUG_RETURN(rnd_next(buf));
}
-int ha_clustrixdb::index_next(uchar *buf)
+int ha_xpand::index_next(uchar *buf)
{
DBUG_ENTER("index_next");
DBUG_RETURN(rnd_next(buf));
}
#if 0
-int ha_clustrixdb::index_next_same(uchar *buf, const uchar *key, uint keylen)
+int ha_xpand::index_next_same(uchar *buf, const uchar *key, uint keylen)
{
DBUG_ENTER("index_next_same");
DBUG_RETURN(rnd_next(buf));
}
#endif
-int ha_clustrixdb::index_prev(uchar *buf)
+int ha_xpand::index_prev(uchar *buf)
{
DBUG_ENTER("index_prev");
DBUG_RETURN(rnd_next(buf));
}
-int ha_clustrixdb::index_end()
+int ha_xpand::index_end()
{
DBUG_ENTER("index_prev");
if (scan_cur)
@@ -882,14 +882,14 @@ int ha_clustrixdb::index_end()
DBUG_RETURN(0);
}
-int ha_clustrixdb::rnd_init(bool scan)
+int ha_xpand::rnd_init(bool scan)
{
- DBUG_ENTER("ha_clustrixdb::rnd_init");
+ DBUG_ENTER("ha_xpand::rnd_init");
int error_code = 0;
THD *thd = ha_thd();
if (thd->lex->sql_command == SQLCOM_UPDATE)
DBUG_RETURN(error_code);
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
@@ -912,12 +912,12 @@ int ha_clustrixdb::rnd_init(bool scan)
bitmap_set_all(&scan_fields);
#endif
- error_code = trx->scan_table(clustrix_table_oid, clx_lock_type,
+ error_code = trx->scan_table(xpand_table_oid, xpd_lock_type,
&scan_fields, THDVAR(thd, row_buffer),
&scan_cur);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
if (error_code)
DBUG_RETURN(error_code);
@@ -925,11 +925,11 @@ int ha_clustrixdb::rnd_init(bool scan)
DBUG_RETURN(0);
}
-int ha_clustrixdb::rnd_next(uchar *buf)
+int ha_xpand::rnd_next(uchar *buf)
{
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -956,14 +956,14 @@ int ha_clustrixdb::rnd_next(uchar *buf)
return 0;
}
-int ha_clustrixdb::rnd_pos(uchar * buf, uchar *pos)
+int ha_xpand::rnd_pos(uchar * buf, uchar *pos)
{
- DBUG_ENTER("clx_rnd_pos");
+ DBUG_ENTER("xpd_rnd_pos");
DBUG_DUMP("pos", pos, ref_length);
int error_code = 0;
THD *thd = ha_thd();
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
@@ -985,7 +985,7 @@ int ha_clustrixdb::rnd_pos(uchar * buf, uchar *pos)
uchar *rowdata = NULL;
ulong rowdata_length;
- if ((error_code = trx->key_read(clustrix_table_oid, 0, clx_lock_type,
+ if ((error_code = trx->key_read(xpand_table_oid, 0, xpd_lock_type,
table->read_set, packed_key, packed_key_len,
&rowdata, &rowdata_length)))
goto err;
@@ -1002,20 +1002,20 @@ err:
my_afree(packed_key);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
- clustrixdb_mark_table_for_discovery(table);
+ xpand_mark_table_for_discovery(table);
DBUG_RETURN(error_code);
}
-int ha_clustrixdb::rnd_end()
+int ha_xpand::rnd_end()
{
- DBUG_ENTER("ha_clustrixdb::rnd_end()");
+ DBUG_ENTER("ha_xpand::rnd_end()");
int error_code = 0;
THD *thd = ha_thd();
if (thd->lex->sql_command == SQLCOM_UPDATE)
DBUG_RETURN(error_code);
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
DBUG_RETURN(error_code);
@@ -1027,9 +1027,9 @@ int ha_clustrixdb::rnd_end()
DBUG_RETURN(0);
}
-void ha_clustrixdb::position(const uchar *record)
+void ha_xpand::position(const uchar *record)
{
- DBUG_ENTER("clx_position");
+ DBUG_ENTER("xpd_position");
if (has_hidden_key) {
memcpy(ref, &last_hidden_key, sizeof(ulonglong));
} else {
@@ -1040,13 +1040,13 @@ void ha_clustrixdb::position(const uchar *record)
DBUG_VOID_RETURN;
}
-uint ha_clustrixdb::lock_count(void) const
+uint ha_xpand::lock_count(void) const
{
/* Hopefully, we don't need to use thread locks */
return 0;
}
-THR_LOCK_DATA **ha_clustrixdb::store_lock(THD *thd,
+THR_LOCK_DATA **ha_xpand::store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
{
@@ -1054,20 +1054,20 @@ THR_LOCK_DATA **ha_clustrixdb::store_lock(THD *thd,
return to;
}
-int ha_clustrixdb::external_lock(THD *thd, int lock_type)
+int ha_xpand::external_lock(THD *thd, int lock_type)
{
- DBUG_ENTER("ha_clustrixdb::external_lock()");
+ DBUG_ENTER("ha_xpand::external_lock()");
int error_code;
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (error_code)
DBUG_RETURN(error_code);
if (lock_type == F_WRLCK)
- clx_lock_type = CLUSTRIX_EXCLUSIVE;
+ xpd_lock_type = XPAND_EXCLUSIVE;
else if (lock_type == F_RDLCK)
- clx_lock_type = CLUSTRIX_SHARED;
+ xpd_lock_type = XPAND_SHARED;
else if (lock_type == F_UNLCK)
- clx_lock_type = CLUSTRIX_NO_LOCKS;
+ xpd_lock_type = XPAND_NO_LOCKS;
if (lock_type != F_UNLCK) {
if (!trx->has_open_transaction()) {
@@ -1076,9 +1076,9 @@ int ha_clustrixdb::external_lock(THD *thd, int lock_type)
DBUG_RETURN(error_code);
}
- trans_register_ha(thd, FALSE, clustrixdb_hton);
+ trans_register_ha(thd, FALSE, xpand_hton);
if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
- trans_register_ha(thd, TRUE, clustrixdb_hton);
+ trans_register_ha(thd, TRUE, xpand_hton);
}
DBUG_RETURN(error_code);
@@ -1088,16 +1088,16 @@ int ha_clustrixdb::external_lock(THD *thd, int lock_type)
Engine Condition Pushdown
****************************************************************************/
-const COND *ha_clustrixdb::cond_push(const COND *cond)
+const COND *ha_xpand::cond_push(const COND *cond)
{
return cond;
}
-void ha_clustrixdb::cond_pop()
+void ha_xpand::cond_pop()
{
}
-int ha_clustrixdb::info_push(uint info_type, void *info)
+int ha_xpand::info_push(uint info_type, void *info)
{
return 0;
}
@@ -1158,7 +1158,7 @@ void remove_current_table_from_rpl_table_list(rpl_group_info *rgi)
delete rgi;
}
-void ha_clustrixdb::build_key_packed_row(uint index, const uchar *buf,
+void ha_xpand::build_key_packed_row(uint index, const uchar *buf,
uchar *packed_key,
size_t *packed_key_len)
{
@@ -1205,9 +1205,9 @@ int unpack_row_to_buf(rpl_group_info *rgi, TABLE *table, uchar *data,
** Plugin Functions
****************************************************************************/
-static int clustrixdb_commit(handlerton *hton, THD *thd, bool all)
+static int xpand_commit(handlerton *hton, THD *thd, bool all)
{
- clustrix_connection* trx = (clustrix_connection *) thd_get_ha_data(thd, hton);
+ xpand_connection* trx = (xpand_connection *) thd_get_ha_data(thd, hton);
assert(trx);
int error_code = 0;
@@ -1221,9 +1221,9 @@ static int clustrixdb_commit(handlerton *hton, THD *thd, bool all)
return error_code;
}
-static int clustrixdb_rollback(handlerton *hton, THD *thd, bool all)
+static int xpand_rollback(handlerton *hton, THD *thd, bool all)
{
- clustrix_connection* trx = (clustrix_connection *) thd_get_ha_data(thd, hton);
+ xpand_connection* trx = (xpand_connection *) thd_get_ha_data(thd, hton);
assert(trx);
int error_code = 0;
@@ -1237,103 +1237,103 @@ static int clustrixdb_rollback(handlerton *hton, THD *thd, bool all)
return error_code;
}
-static handler* clustrixdb_create_handler(handlerton *hton, TABLE_SHARE *table,
+static handler* xpand_create_handler(handlerton *hton, TABLE_SHARE *table,
MEM_ROOT *mem_root)
{
- return new (mem_root) ha_clustrixdb(hton, table);
+ return new (mem_root) ha_xpand(hton, table);
}
-static int clustrixdb_close_connection(handlerton* hton, THD* thd)
+static int xpand_close_connection(handlerton* hton, THD* thd)
{
- clustrix_connection* trx = (clustrix_connection *) thd_get_ha_data(thd, hton);
+ xpand_connection* trx = (xpand_connection *) thd_get_ha_data(thd, hton);
if (!trx)
return 0; /* Transaction is not started */
- int error_code = clustrixdb_rollback(clustrixdb_hton, thd, TRUE);
+ int error_code = xpand_rollback(xpand_hton, thd, TRUE);
delete trx;
return error_code;
}
-static int clustrixdb_panic(handlerton *hton, ha_panic_function type)
+static int xpand_panic(handlerton *hton, ha_panic_function type)
{
return 0;
}
-static bool clustrixdb_show_status(handlerton *hton, THD *thd,
+static bool xpand_show_status(handlerton *hton, THD *thd,
stat_print_fn *stat_print,
enum ha_stat_type stat_type)
{
return FALSE;
}
-static int clustrixdb_discover_table_names(handlerton *hton, LEX_CSTRING *db,
+static int xpand_discover_table_names(handlerton *hton, LEX_CSTRING *db,
MY_DIR *dir,
handlerton::discovered_list *result)
{
- clustrix_connection *clustrix_net = new clustrix_connection();
- int error_code = clustrix_net->connect();
+ xpand_connection *xpand_net = new xpand_connection();
+ int error_code = xpand_net->connect();
if (error_code)
goto err;
- clustrix_net->populate_table_list(db, result);
+ xpand_net->populate_table_list(db, result);
err:
- delete clustrix_net;
+ delete xpand_net;
return error_code;
}
-int clustrixdb_discover_table(handlerton *hton, THD *thd, TABLE_SHARE *share)
+int xpand_discover_table(handlerton *hton, THD *thd, TABLE_SHARE *share)
{
- clustrix_connection *clustrix_net = new clustrix_connection();
- int error_code = clustrix_net->connect();
+ xpand_connection *xpand_net = new xpand_connection();
+ int error_code = xpand_net->connect();
if (error_code)
goto err;
- error_code = clustrix_net->discover_table_details(&share->db,
+ error_code = xpand_net->discover_table_details(&share->db,
&share->table_name,
thd, share);
err:
- delete clustrix_net;
+ delete xpand_net;
return error_code;
}
-static int clustrixdb_init(void *p)
+static int xpand_init(void *p)
{
- DBUG_ENTER("clustrixdb_init");
- clustrixdb_hton = (handlerton *) p;
- clustrixdb_hton->flags = HTON_NO_FLAGS;
- clustrixdb_hton->panic = clustrixdb_panic;
- clustrixdb_hton->close_connection = clustrixdb_close_connection;
- clustrixdb_hton->commit = clustrixdb_commit;
- clustrixdb_hton->rollback = clustrixdb_rollback;
- clustrixdb_hton->create = clustrixdb_create_handler;
- clustrixdb_hton->show_status = clustrixdb_show_status;
- clustrixdb_hton->discover_table_names = clustrixdb_discover_table_names;
- clustrixdb_hton->discover_table = clustrixdb_discover_table;
- clustrixdb_hton->create_select = create_clustrixdb_select_handler;
- clustrixdb_hton->create_derived = create_clustrixdb_derived_handler;
+ DBUG_ENTER("xpand_init");
+ xpand_hton = (handlerton *) p;
+ xpand_hton->flags = HTON_NO_FLAGS;
+ xpand_hton->panic = xpand_panic;
+ xpand_hton->close_connection = xpand_close_connection;
+ xpand_hton->commit = xpand_commit;
+ xpand_hton->rollback = xpand_rollback;
+ xpand_hton->create = xpand_create_handler;
+ xpand_hton->show_status = xpand_show_status;
+ xpand_hton->discover_table_names = xpand_discover_table_names;
+ xpand_hton->discover_table = xpand_discover_table;
+ xpand_hton->create_select = create_xpand_select_handler;
+ xpand_hton->create_derived = create_xpand_derived_handler;
- update_host_list(clustrix_host);
+ update_host_list(xpand_host);
DBUG_RETURN(0);
}
-static int clustrixdb_deinit(void *p)
+static int xpand_deinit(void *p)
{
- DBUG_ENTER("clustrixdb_deinit");
+ DBUG_ENTER("xpand_deinit");
free_host_list();
DBUG_RETURN(0);
}
-struct st_mysql_show_var clustrixdb_status_vars[] =
+struct st_mysql_show_var xpand_status_vars[] =
{
{NullS, NullS, SHOW_LONG}
};
-static struct st_mysql_sys_var* clustrixdb_system_variables[] =
+static struct st_mysql_sys_var* xpand_system_variables[] =
{
MYSQL_SYSVAR(connect_timeout),
MYSQL_SYSVAR(read_timeout),
@@ -1350,22 +1350,22 @@ static struct st_mysql_sys_var* clustrixdb_system_variables[] =
NULL
};
-static struct st_mysql_storage_engine clustrixdb_storage_engine =
+static struct st_mysql_storage_engine xpand_storage_engine =
{MYSQL_HANDLERTON_INTERFACE_VERSION};
-maria_declare_plugin(clustrixdb)
+maria_declare_plugin(xpand)
{
MYSQL_STORAGE_ENGINE_PLUGIN, /* Plugin Type */
- &clustrixdb_storage_engine, /* Plugin Descriptor */
- "CLUSTRIXDB", /* Plugin Name */
+ &xpand_storage_engine, /* Plugin Descriptor */
+ "XPAND", /* Plugin Name */
"MariaDB", /* Plugin Author */
- "ClustrixDB storage engine", /* Plugin Description */
+ "Xpand storage engine", /* Plugin Description */
PLUGIN_LICENSE_GPL, /* Plugin Licence */
- clustrixdb_init, /* Plugin Entry Point */
- clustrixdb_deinit, /* Plugin Deinitializer */
+ xpand_init, /* Plugin Entry Point */
+ xpand_deinit, /* Plugin Deinitializer */
0x0001, /* Hex Version Number (0.1) */
- NULL /* clustrixdb_status_vars */, /* Status Variables */
- clustrixdb_system_variables, /* System Variables */
+ NULL /* xpand_status_vars */, /* Status Variables */
+ xpand_system_variables, /* System Variables */
"0.1", /* String Version */
MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* Maturity Level */
}
diff --git a/storage/clustrixdb/ha_clustrixdb.h b/storage/xpand/ha_xpand.h
index 461b17e4438..48359af6470 100644
--- a/storage/clustrixdb/ha_clustrixdb.h
+++ b/storage/xpand/ha_xpand.h
@@ -2,15 +2,15 @@
Copyright (c) 2019, MariaDB Corporation.
*****************************************************************************/
-#ifndef _ha_clustrixdb_h
-#define _ha_clustrixdb_h
+#ifndef _ha_xpand_h
+#define _ha_xpand_h
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
#define MYSQL_SERVER 1
-#include "clustrix_connection.h"
+#include "xpand_connection.h"
#include "my_bitmap.h"
#include "table.h"
#include "rpl_rli.h"
@@ -21,7 +21,7 @@ Copyright (c) 2019, MariaDB Corporation.
#include "../../sql/rpl_record.h"
size_t estimate_row_size(TABLE *table);
-clustrix_connection *get_trx(THD *thd, int *error_code);
+xpand_connection *get_trx(THD *thd, int *error_code);
bool get_enable_sh(THD* thd);
void add_current_table_to_rpl_table_list(rpl_group_info **_rgi, THD *thd,
TABLE *table);
@@ -30,10 +30,10 @@ int unpack_row_to_buf(rpl_group_info *rgi, TABLE *table, uchar *data,
uchar const *const row_data, MY_BITMAP const *cols,
uchar const *const row_end);
-class ha_clustrixdb : public handler
+class ha_xpand : public handler
{
private:
- ulonglong clustrix_table_oid;
+ ulonglong xpand_table_oid;
rpl_group_info *rgi;
Field *auto_inc_field;
@@ -41,24 +41,24 @@ private:
bool has_hidden_key;
ulonglong last_hidden_key;
- clustrix_connection_cursor *scan_cur;
+ xpand_connection_cursor *scan_cur;
bool is_scan;
MY_BITMAP scan_fields;
bool sorted_scan;
- clustrix_lock_mode_t clx_lock_type;
+ xpand_lock_mode_t xpd_lock_type;
uint last_dup_errkey;
- typedef enum clustrix_upsert_flags {
- CLUSTRIX_HAS_UPSERT= 1,
- CLUSTRIX_BULK_UPSERT= 2,
- CLUSTRIX_UPSERT_SENT= 4
- } clx_upsert_flags_t;
+ typedef enum xpand_upsert_flags {
+ XPAND_HAS_UPSERT= 1,
+ XPAND_BULK_UPSERT= 2,
+ XPAND_UPSERT_SENT= 4
+ } xpd_upsert_flags_t;
int upsert_flag;
public:
- ha_clustrixdb(handlerton *hton, TABLE_SHARE *table_arg);
- ~ha_clustrixdb();
+ ha_xpand(handlerton *hton, TABLE_SHARE *table_arg);
+ ~ha_xpand();
int create(const char *name, TABLE *form, HA_CREATE_INFO *info);
int delete_table(const char *name);
int rename_table(const char* from, const char* to);
@@ -127,4 +127,4 @@ private:
bool select_handler_setting(THD* thd);
bool derived_handler_setting(THD* thd);
uint row_buffer_setting(THD* thd);
-#endif // _ha_clustrixdb_h
+#endif // _ha_xpand_h
diff --git a/storage/clustrixdb/ha_clustrixdb_pushdown.cc b/storage/xpand/ha_xpand_pushdown.cc
index 58cf01cce44..e53c4f445fa 100644
--- a/storage/clustrixdb/ha_clustrixdb_pushdown.cc
+++ b/storage/xpand/ha_xpand_pushdown.cc
@@ -2,11 +2,11 @@
Copyright (c) 2019, MariaDB Corporation.
*****************************************************************************/
-#include "ha_clustrixdb.h"
-#include "ha_clustrixdb_pushdown.h"
+#include "ha_xpand.h"
+#include "ha_xpand_pushdown.h"
-extern handlerton *clustrixdb_hton;
-extern uint clustrix_row_buffer;
+extern handlerton *xpand_hton;
+extern uint xpand_row_buffer;
/*@brief Fills up array data types, metadata and nullability*/
/************************************************************
@@ -87,7 +87,7 @@ err:
}
-/*@brief create_clustrixdb_select_handler- Creates handler*/
+/*@brief create_xpand_select_handler- Creates handler*/
/************************************************************
* DESCRIPTION:
* Creates a select handler
@@ -100,9 +100,9 @@ err:
* NULL otherwise
************************************************************/
select_handler*
-create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
+create_xpand_select_handler(THD* thd, SELECT_LEX* select_lex)
{
- ha_clustrixdb_select_handler *sh = NULL;
+ ha_xpand_select_handler *sh = NULL;
if (!select_handler_setting(thd)) {
return sh;
}
@@ -110,9 +110,9 @@ create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
// TODO Return early for EXPLAIN before we run the actual scan.
// We can send compile request when we separate compilation
// and execution.
- clustrix_connection_cursor *scan = NULL;
+ xpand_connection_cursor *scan = NULL;
if (thd->lex->describe) {
- sh = new ha_clustrixdb_select_handler(thd, select_lex, scan);
+ sh = new ha_xpand_select_handler(thd, select_lex, scan);
return sh;
}
@@ -127,7 +127,7 @@ create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
select_lex->print(thd, &query, QT_ORDINARY);
int error_code = 0;
int field_metadata_size = 0;
- clustrix_connection *trx = NULL;
+ xpand_connection *trx = NULL;
// We presume this number is equal to types.elements in get_field_types
uint items_number = select_lex->get_item_list()->elements;
@@ -163,7 +163,7 @@ create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
goto err;
}
- sh = new ha_clustrixdb_select_handler(thd, select_lex, scan);
+ sh = new ha_xpand_select_handler(thd, select_lex, scan);
err:
// deallocate buffers
@@ -180,11 +180,11 @@ err:
* thd - THD pointer.
* select_lex - sematic tree for the query.
**********************************************************/
-ha_clustrixdb_select_handler::ha_clustrixdb_select_handler(
+ha_xpand_select_handler::ha_xpand_select_handler(
THD *thd,
SELECT_LEX* select_lex,
- clustrix_connection_cursor *scan_)
- : select_handler(thd, clustrixdb_hton)
+ xpand_connection_cursor *scan_)
+ : select_handler(thd, xpand_hton)
{
thd__ = thd;
scan = scan_;
@@ -198,10 +198,10 @@ ha_clustrixdb_select_handler::ha_clustrixdb_select_handler(
* This frees dynamic memory allocated for bitmap
* and disables replication to SH temp table.
**********************************************************/
-ha_clustrixdb_select_handler::~ha_clustrixdb_select_handler()
+ha_xpand_select_handler::~ha_xpand_select_handler()
{
int error_code;
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx) {
// TBD Log this
}
@@ -225,7 +225,7 @@ ha_clustrixdb_select_handler::~ha_clustrixdb_select_handler()
* RETURN:
* rc as int
* ********************************************************/
-int ha_clustrixdb_select_handler::init_scan()
+int ha_xpand_select_handler::init_scan()
{
// Save this into the base handler class attribute
table__ = table;
@@ -247,10 +247,10 @@ int ha_clustrixdb_select_handler::init_scan()
* RETURN:
* rc as int
* ********************************************************/
-int ha_clustrixdb_select_handler::next_row()
+int ha_xpand_select_handler::next_row()
{
int error_code = 0;
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -282,12 +282,12 @@ int ha_clustrixdb_select_handler::next_row()
* RETURN:
* rc as int
***********************************************************/
-int ha_clustrixdb_select_handler::end_scan()
+int ha_xpand_select_handler::end_scan()
{
return 0;
}
-/*@brief create_clustrixdb_derived_handler- Creates handler*/
+/*@brief create_xpand_derived_handler- Creates handler*/
/************************************************************
* DESCRIPTION:
* Creates a derived handler
@@ -300,9 +300,9 @@ int ha_clustrixdb_select_handler::end_scan()
* NULL otherwise
************************************************************/
derived_handler*
-create_clustrixdb_derived_handler(THD* thd, TABLE_LIST *derived)
+create_xpand_derived_handler(THD* thd, TABLE_LIST *derived)
{
- ha_clustrixdb_derived_handler *dh = NULL;
+ ha_xpand_derived_handler *dh = NULL;
if (!derived_handler_setting(thd)) {
return dh;
}
@@ -311,7 +311,7 @@ create_clustrixdb_derived_handler(THD* thd, TABLE_LIST *derived)
SELECT_LEX *select_lex = unit->first_select();
String query;
- dh = new ha_clustrixdb_derived_handler(thd, select_lex, NULL);
+ dh = new ha_xpand_derived_handler(thd, select_lex, NULL);
return dh;
}
@@ -323,11 +323,11 @@ create_clustrixdb_derived_handler(THD* thd, TABLE_LIST *derived)
* thd - THD pointer.
* select_lex - sematic tree for the query.
**********************************************************/
-ha_clustrixdb_derived_handler::ha_clustrixdb_derived_handler(
+ha_xpand_derived_handler::ha_xpand_derived_handler(
THD *thd,
SELECT_LEX* select_lex,
- clustrix_connection_cursor *scan_)
- : derived_handler(thd, clustrixdb_hton)
+ xpand_connection_cursor *scan_)
+ : derived_handler(thd, xpand_hton)
{
thd__ = thd;
scan = scan_;
@@ -341,13 +341,13 @@ ha_clustrixdb_derived_handler::ha_clustrixdb_derived_handler(
* This frees dynamic memory allocated for bitmap
* and disables replication to SH temp table.
**********************************************************/
-ha_clustrixdb_derived_handler::~ha_clustrixdb_derived_handler()
+ha_xpand_derived_handler::~ha_xpand_derived_handler()
{
int error_code;
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx) {
// TBD Log this.
}
@@ -371,14 +371,14 @@ ha_clustrixdb_derived_handler::~ha_clustrixdb_derived_handler()
* RETURN:
* rc as int
* ********************************************************/
-int ha_clustrixdb_derived_handler::init_scan()
+int ha_xpand_derived_handler::init_scan()
{
String query;
// Print the query into a string provided
select->print(thd__, &query, QT_ORDINARY);
int error_code = 0;
int field_metadata_size = 0;
- clustrix_connection *trx = NULL;
+ xpand_connection *trx = NULL;
// We presume this number is equal to types.elements in get_field_types
uint items_number= select->get_item_list()->elements;
@@ -437,10 +437,10 @@ err:
* RETURN:
* rc as int
* ********************************************************/
-int ha_clustrixdb_derived_handler::next_row()
+int ha_xpand_derived_handler::next_row()
{
int error_code = 0;
- clustrix_connection *trx = get_trx(thd, &error_code);
+ xpand_connection *trx = get_trx(thd, &error_code);
if (!trx)
return error_code;
@@ -472,7 +472,7 @@ int ha_clustrixdb_derived_handler::next_row()
* RETURN:
* rc as int
***********************************************************/
-int ha_clustrixdb_derived_handler::end_scan()
+int ha_xpand_derived_handler::end_scan()
{
return 0;
}
diff --git a/storage/clustrixdb/ha_clustrixdb_pushdown.h b/storage/xpand/ha_xpand_pushdown.h
index 2f08bd427b0..3fd234131c9 100644
--- a/storage/clustrixdb/ha_clustrixdb_pushdown.h
+++ b/storage/xpand/ha_xpand_pushdown.h
@@ -1,8 +1,8 @@
/*****************************************************************************
Copyright (c) 2019, MariaDB Corporation.
*****************************************************************************/
-#ifndef _ha_clustrixdb_pushdown_h
-#define _ha_clustrixdb_pushdown_h
+#ifndef _ha_xpand_pushdown_h
+#define _ha_xpand_pushdown_h
#include "select_handler.h"
#include "derived_handler.h"
@@ -13,12 +13,12 @@ Copyright (c) 2019, MariaDB Corporation.
* DESCRIPTION:
* To be described
************************************************************/
-class ha_clustrixdb_base_handler
+class ha_xpand_base_handler
{
// To simulate abstract class
protected:
- ha_clustrixdb_base_handler(): thd__(0),table__(0) {}
- ~ha_clustrixdb_base_handler() {}
+ ha_xpand_base_handler(): thd__(0),table__(0) {}
+ ~ha_xpand_base_handler() {}
// Copies of pushdown handlers attributes
// to use them in shared methods.
@@ -26,10 +26,10 @@ class ha_clustrixdb_base_handler
TABLE *table__;
// The bitmap used to sent
MY_BITMAP scan_fields;
- // Structures to unpack RBR rows from CLX BE
+ // Structures to unpack RBR rows from XPD BE
rpl_group_info *rgi;
- // CLX BE scan operation reference
- clustrix_connection_cursor *scan;
+ // XPD BE scan operation reference
+ xpand_connection_cursor *scan;
};
/*@brief select_handler class*/
@@ -40,14 +40,14 @@ class ha_clustrixdb_base_handler
* More details in server/sql/select_handler.h
* sel semantic tree for the query in SELECT_LEX.
************************************************************/
-class ha_clustrixdb_select_handler:
- private ha_clustrixdb_base_handler,
+class ha_xpand_select_handler:
+ private ha_xpand_base_handler,
public select_handler
{
public:
- ha_clustrixdb_select_handler(THD* thd_arg, SELECT_LEX* sel,
- clustrix_connection_cursor *scan);
- ~ha_clustrixdb_select_handler();
+ ha_xpand_select_handler(THD* thd_arg, SELECT_LEX* sel,
+ xpand_connection_cursor *scan);
+ ~ha_xpand_select_handler();
int init_scan();
int next_row();
@@ -63,14 +63,14 @@ class ha_clustrixdb_select_handler:
* More details in server/sql/derived_handler.h
* sel semantic tree for the query in SELECT_LEX.
************************************************************/
-class ha_clustrixdb_derived_handler:
- private ha_clustrixdb_base_handler,
+class ha_xpand_derived_handler:
+ private ha_xpand_base_handler,
public derived_handler
{
public:
- ha_clustrixdb_derived_handler(THD* thd_arg, SELECT_LEX* sel,
- clustrix_connection_cursor *scan);
- ~ha_clustrixdb_derived_handler();
+ ha_xpand_derived_handler(THD* thd_arg, SELECT_LEX* sel,
+ xpand_connection_cursor *scan);
+ ~ha_xpand_derived_handler();
int init_scan();
int next_row();
@@ -79,9 +79,9 @@ class ha_clustrixdb_derived_handler:
};
-select_handler *create_clustrixdb_select_handler(THD* thd,
+select_handler *create_xpand_select_handler(THD* thd,
SELECT_LEX* select_lex);
-derived_handler *create_clustrixdb_derived_handler(THD* thd,
+derived_handler *create_xpand_derived_handler(THD* thd,
TABLE_LIST *derived);
#endif
diff --git a/storage/clustrixdb/clustrix_connection.cc b/storage/xpand/xpand_connection.cc
index f03f43acaeb..fac728f291c 100644
--- a/storage/clustrixdb/clustrix_connection.cc
+++ b/storage/xpand/xpand_connection.cc
@@ -2,22 +2,22 @@
Copyright (c) 2019, MariaDB Corporation.
*****************************************************************************/
-/** @file clustrix_connection.cc */
+/** @file xpand_connection.cc */
-#include "clustrix_connection.h"
+#include "xpand_connection.h"
#include <string>
#include "errmsg.h"
#include "handler.h"
#include "table.h"
-extern int clustrix_connect_timeout;
-extern int clustrix_read_timeout;
-extern int clustrix_write_timeout;
-extern char *clustrix_host;
-extern char *clustrix_username;
-extern char *clustrix_password;
-extern uint clustrix_port;
-extern char *clustrix_socket;
+extern int xpand_connect_timeout;
+extern int xpand_read_timeout;
+extern int xpand_write_timeout;
+extern char *xpand_host;
+extern char *xpand_username;
+extern char *xpand_password;
+extern uint xpand_port;
+extern char *xpand_socket;
/*
This class implements the commands that can be sent to the cluster by the
@@ -44,56 +44,56 @@ extern char *clustrix_socket;
The rollback statement command can likewise change the state from NEW_STMT to
STARTED without sending anything to the cluster.
- In addition, the CLUSTRIX_TRANS_AUTOCOMMIT flag will cause the transactions
+ In addition, the XPAND_TRANS_AUTOCOMMIT flag will cause the transactions
for commands that complete without leaving open invocations on the cluster to
be committed if successful or rolled back if there was an error. If
auto-commit is enabled, only one open invocation may be in progress at a
time.
*/
-enum clustrix_trans_state {
- CLUSTRIX_TRANS_STARTED = 0,
- CLUSTRIX_TRANS_REQUESTED = 1,
- CLUSTRIX_TRANS_NEW_STMT = 2,
- CLUSTRIX_TRANS_ROLLBACK_STMT = 4,
- CLUSTRIX_TRANS_NONE = 32,
+enum xpand_trans_state {
+ XPAND_TRANS_STARTED = 0,
+ XPAND_TRANS_REQUESTED = 1,
+ XPAND_TRANS_NEW_STMT = 2,
+ XPAND_TRANS_ROLLBACK_STMT = 4,
+ XPAND_TRANS_NONE = 32,
};
-enum clustrix_trans_post_flags {
- CLUSTRIX_TRANS_AUTOCOMMIT = 8,
- CLUSTRIX_TRANS_NO_POST_FLAGS = 0,
+enum xpand_trans_post_flags {
+ XPAND_TRANS_AUTOCOMMIT = 8,
+ XPAND_TRANS_NO_POST_FLAGS = 0,
};
-enum clustrix_commands {
- CLUSTRIX_WRITE_ROW = 1,
- CLUSTRIX_SCAN_TABLE,
- CLUSTRIX_SCAN_NEXT,
- CLUSTRIX_SCAN_STOP,
- CLUSTRIX_KEY_READ,
- CLUSTRIX_KEY_DELETE,
- CLUSTRIX_SCAN_QUERY,
- CLUSTRIX_KEY_UPDATE,
- CLUSTRIX_SCAN_FROM_KEY,
- CLUSTRIX_UPDATE_QUERY,
- CLUSTRIX_COMMIT,
- CLUSTRIX_ROLLBACK,
+enum xpand_commands {
+ XPAND_WRITE_ROW = 1,
+ XPAND_SCAN_TABLE,
+ XPAND_SCAN_NEXT,
+ XPAND_SCAN_STOP,
+ XPAND_KEY_READ,
+ XPAND_KEY_DELETE,
+ XPAND_SCAN_QUERY,
+ XPAND_KEY_UPDATE,
+ XPAND_SCAN_FROM_KEY,
+ XPAND_UPDATE_QUERY,
+ XPAND_COMMIT,
+ XPAND_ROLLBACK,
};
/****************************************************************************
-** Class clustrix_connection
+** Class xpand_connection
****************************************************************************/
-clustrix_connection::clustrix_connection()
+xpand_connection::xpand_connection()
: command_buffer(NULL), command_buffer_length(0), command_length(0),
- trans_state(CLUSTRIX_TRANS_NONE), trans_flags(CLUSTRIX_TRANS_NO_POST_FLAGS)
+ trans_state(XPAND_TRANS_NONE), trans_flags(XPAND_TRANS_NO_POST_FLAGS)
{
- DBUG_ENTER("clustrix_connection::clustrix_connection");
- memset(&clustrix_net, 0, sizeof(MYSQL));
+ DBUG_ENTER("xpand_connection::xpand_connection");
+ memset(&xpand_net, 0, sizeof(MYSQL));
DBUG_VOID_RETURN;
}
-clustrix_connection::~clustrix_connection()
+xpand_connection::~xpand_connection()
{
- DBUG_ENTER("clustrix_connection::~clustrix_connection");
+ DBUG_ENTER("xpand_connection::~xpand_connection");
if (is_connected())
disconnect(TRUE);
@@ -102,9 +102,9 @@ clustrix_connection::~clustrix_connection()
DBUG_VOID_RETURN;
}
-void clustrix_connection::disconnect(bool is_destructor)
+void xpand_connection::disconnect(bool is_destructor)
{
- DBUG_ENTER("clustrix_connection::disconnect");
+ DBUG_ENTER("xpand_connection::disconnect");
if (is_destructor)
{
/*
@@ -112,9 +112,9 @@ void clustrix_connection::disconnect(bool is_destructor)
the thread used by the network has begun, so usage of that
thread object now is not reliable
*/
- clustrix_net.net.thd = NULL;
+ xpand_net.net.thd = NULL;
}
- mysql_close(&clustrix_net);
+ mysql_close(&xpand_net);
DBUG_VOID_RETURN;
}
@@ -122,11 +122,11 @@ int host_list_next;
extern int host_list_cnt;
extern char **host_list;
-int clustrix_connection::connect()
+int xpand_connection::connect()
{
int error_code = 0;
my_bool my_true = 1;
- DBUG_ENTER("clustrix_connection::connect");
+ DBUG_ENTER("xpand_connection::connect");
// cpu concurrency by damned!
int host_num = host_list_next;
@@ -136,50 +136,50 @@ int clustrix_connection::connect()
DBUG_PRINT("host", ("%s", host));
/* Validate the connection parameters */
- if (!strcmp(clustrix_socket, ""))
+ if (!strcmp(xpand_socket, ""))
if (!strcmp(host, "127.0.0.1"))
- if (clustrix_port == MYSQL_PORT_DEFAULT)
+ if (xpand_port == MYSQL_PORT_DEFAULT)
DBUG_RETURN(ER_CONNECT_TO_FOREIGN_DATA_SOURCE);
- //clustrix_net.methods = &connection_methods;
+ //xpand_net.methods = &connection_methods;
- if (!mysql_init(&clustrix_net))
+ if (!mysql_init(&xpand_net))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- mysql_options(&clustrix_net, MYSQL_OPT_READ_TIMEOUT,
- &clustrix_read_timeout);
- mysql_options(&clustrix_net, MYSQL_OPT_WRITE_TIMEOUT,
- &clustrix_write_timeout);
- mysql_options(&clustrix_net, MYSQL_OPT_CONNECT_TIMEOUT,
- &clustrix_connect_timeout);
- mysql_options(&clustrix_net, MYSQL_OPT_USE_REMOTE_CONNECTION,
+ mysql_options(&xpand_net, MYSQL_OPT_READ_TIMEOUT,
+ &xpand_read_timeout);
+ mysql_options(&xpand_net, MYSQL_OPT_WRITE_TIMEOUT,
+ &xpand_write_timeout);
+ mysql_options(&xpand_net, MYSQL_OPT_CONNECT_TIMEOUT,
+ &xpand_connect_timeout);
+ mysql_options(&xpand_net, MYSQL_OPT_USE_REMOTE_CONNECTION,
NULL);
- mysql_options(&clustrix_net, MYSQL_SET_CHARSET_NAME, "utf8mb4");
- mysql_options(&clustrix_net, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY,
+ mysql_options(&xpand_net, MYSQL_SET_CHARSET_NAME, "utf8mb4");
+ mysql_options(&xpand_net, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY,
(char *) &my_true);
- mysql_options(&clustrix_net, MYSQL_INIT_COMMAND,"SET autocommit=0");
+ mysql_options(&xpand_net, MYSQL_INIT_COMMAND,"SET autocommit=0");
-#ifdef CLUSTRIX_CONNECTION_SSL
+#ifdef XPAND_CONNECTION_SSL
if (opt_ssl_ca_length | conn->tgt_ssl_capath_length |
conn->tgt_ssl_cert_length | conn->tgt_ssl_key_length)
{
- mysql_ssl_set(&clustrix_net, conn->tgt_ssl_key, conn->tgt_ssl_cert,
+ mysql_ssl_set(&xpand_net, conn->tgt_ssl_key, conn->tgt_ssl_cert,
conn->tgt_ssl_ca, conn->tgt_ssl_capath, conn->tgt_ssl_cipher);
if (conn->tgt_ssl_vsc)
{
my_bool verify_flg = TRUE;
- mysql_options(&clustrix_net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ mysql_options(&xpand_net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&verify_flg);
}
}
#endif
- if (!mysql_real_connect(&clustrix_net, host,
- clustrix_username, clustrix_password,
- NULL, clustrix_port, clustrix_socket,
+ if (!mysql_real_connect(&xpand_net, host,
+ xpand_username, xpand_password,
+ NULL, xpand_port, xpand_socket,
CLIENT_MULTI_STATEMENTS))
{
- error_code = mysql_errno(&clustrix_net);
+ error_code = mysql_errno(&xpand_net);
disconnect();
if (error_code != CR_CONN_HOST_ERROR &&
@@ -195,14 +195,14 @@ int clustrix_connection::connect()
}
}
- clustrix_net.reconnect = 1;
+ xpand_net.reconnect = 1;
DBUG_RETURN(0);
}
-int clustrix_connection::begin_command(uchar command)
+int xpand_connection::begin_command(uchar command)
{
- if (trans_state == CLUSTRIX_TRANS_NONE)
+ if (trans_state == XPAND_TRANS_NONE)
return HA_ERR_INTERNAL_ERROR;
command_length = 0;
@@ -216,7 +216,7 @@ int clustrix_connection::begin_command(uchar command)
return error_code;
}
-int clustrix_connection::send_command()
+int xpand_connection::send_command()
{
my_bool com_error;
@@ -233,59 +233,59 @@ int clustrix_connection::send_command()
because it needs to be sent with each command until the transaction is
committed or rolled back.
*/
- trans_state = CLUSTRIX_TRANS_STARTED;
+ trans_state = XPAND_TRANS_STARTED;
- com_error = simple_command(&clustrix_net,
- (enum_server_command)CLUSTRIX_SERVER_REQUEST,
+ com_error = simple_command(&xpand_net,
+ (enum_server_command)XPAND_SERVER_REQUEST,
command_buffer, command_length, TRUE);
if (com_error)
{
- int error_code = mysql_errno(&clustrix_net);
+ int error_code = mysql_errno(&xpand_net);
my_printf_error(error_code,
- "Clustrix error: %s", MYF(0),
- mysql_error(&clustrix_net));
+ "Xpand error: %s", MYF(0),
+ mysql_error(&xpand_net));
return error_code;
}
return 0;
}
-int clustrix_connection::read_query_response()
+int xpand_connection::read_query_response()
{
- my_bool comerr = clustrix_net.methods->read_query_result(&clustrix_net);
+ my_bool comerr = xpand_net.methods->read_query_result(&xpand_net);
int error_code = 0;
if (comerr)
{
- error_code = mysql_errno(&clustrix_net);
+ error_code = mysql_errno(&xpand_net);
my_printf_error(error_code,
- "Clustrix error: %s", MYF(0),
- mysql_error(&clustrix_net));
+ "Xpand error: %s", MYF(0),
+ mysql_error(&xpand_net));
}
auto_commit_closed();
return error_code;
}
-bool clustrix_connection::has_open_transaction()
+bool xpand_connection::has_open_transaction()
{
- return trans_state != CLUSTRIX_TRANS_NONE;
+ return trans_state != XPAND_TRANS_NONE;
}
-int clustrix_connection::commit_transaction()
+int xpand_connection::commit_transaction()
{
- DBUG_ENTER("clustrix_connection::commit_transaction");
- if (trans_state == CLUSTRIX_TRANS_NONE)
+ DBUG_ENTER("xpand_connection::commit_transaction");
+ if (trans_state == XPAND_TRANS_NONE)
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
- if (trans_state == CLUSTRIX_TRANS_REQUESTED) {
- trans_state = CLUSTRIX_TRANS_NONE;
- trans_flags = CLUSTRIX_TRANS_NO_POST_FLAGS;
+ if (trans_state == XPAND_TRANS_REQUESTED) {
+ trans_state = XPAND_TRANS_NONE;
+ trans_flags = XPAND_TRANS_NO_POST_FLAGS;
DBUG_RETURN(0);
}
int error_code;
- if ((error_code = begin_command(CLUSTRIX_COMMIT)))
+ if ((error_code = begin_command(XPAND_COMMIT)))
DBUG_RETURN(error_code);
if ((error_code = send_command()))
@@ -294,22 +294,22 @@ int clustrix_connection::commit_transaction()
if ((error_code = read_query_response()))
DBUG_RETURN(error_code);
- trans_state = CLUSTRIX_TRANS_NONE;
- trans_flags = CLUSTRIX_TRANS_NO_POST_FLAGS;
+ trans_state = XPAND_TRANS_NONE;
+ trans_flags = XPAND_TRANS_NO_POST_FLAGS;
DBUG_RETURN(error_code);
}
-int clustrix_connection::rollback_transaction()
+int xpand_connection::rollback_transaction()
{
- DBUG_ENTER("clustrix_connection::rollback_transaction");
- if (trans_state == CLUSTRIX_TRANS_NONE ||
- trans_state == CLUSTRIX_TRANS_REQUESTED) {
- trans_state = CLUSTRIX_TRANS_NONE;
+ DBUG_ENTER("xpand_connection::rollback_transaction");
+ if (trans_state == XPAND_TRANS_NONE ||
+ trans_state == XPAND_TRANS_REQUESTED) {
+ trans_state = XPAND_TRANS_NONE;
DBUG_RETURN(0);
}
int error_code;
- if ((error_code = begin_command(CLUSTRIX_ROLLBACK)))
+ if ((error_code = begin_command(XPAND_ROLLBACK)))
DBUG_RETURN(error_code);
if ((error_code = send_command()))
@@ -318,66 +318,66 @@ int clustrix_connection::rollback_transaction()
if ((error_code = read_query_response()))
DBUG_RETURN(error_code);
- trans_state = CLUSTRIX_TRANS_NONE;
- trans_flags = CLUSTRIX_TRANS_NO_POST_FLAGS;
+ trans_state = XPAND_TRANS_NONE;
+ trans_flags = XPAND_TRANS_NO_POST_FLAGS;
DBUG_RETURN(error_code);
}
-int clustrix_connection::begin_transaction_next()
+int xpand_connection::begin_transaction_next()
{
- DBUG_ENTER("clustrix_connection::begin_transaction_next");
- if (trans_state != CLUSTRIX_TRANS_NONE ||
- trans_flags != CLUSTRIX_TRANS_NO_POST_FLAGS)
+ DBUG_ENTER("xpand_connection::begin_transaction_next");
+ if (trans_state != XPAND_TRANS_NONE ||
+ trans_flags != XPAND_TRANS_NO_POST_FLAGS)
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
- trans_state = CLUSTRIX_TRANS_REQUESTED;
+ trans_state = XPAND_TRANS_REQUESTED;
DBUG_RETURN(0);
}
-int clustrix_connection::new_statement_next()
+int xpand_connection::new_statement_next()
{
- DBUG_ENTER("clustrix_connection::new_statement_next");
- if (trans_state != CLUSTRIX_TRANS_STARTED ||
- trans_flags != CLUSTRIX_TRANS_NO_POST_FLAGS)
+ DBUG_ENTER("xpand_connection::new_statement_next");
+ if (trans_state != XPAND_TRANS_STARTED ||
+ trans_flags != XPAND_TRANS_NO_POST_FLAGS)
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
- trans_state = CLUSTRIX_TRANS_NEW_STMT;
+ trans_state = XPAND_TRANS_NEW_STMT;
DBUG_RETURN(0);
}
-int clustrix_connection::rollback_statement_next()
+int xpand_connection::rollback_statement_next()
{
- DBUG_ENTER("clustrix_connection::rollback_statement_next");
- if (trans_state != CLUSTRIX_TRANS_STARTED ||
- trans_flags != CLUSTRIX_TRANS_NO_POST_FLAGS)
+ DBUG_ENTER("xpand_connection::rollback_statement_next");
+ if (trans_state != XPAND_TRANS_STARTED ||
+ trans_flags != XPAND_TRANS_NO_POST_FLAGS)
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
- trans_state = CLUSTRIX_TRANS_ROLLBACK_STMT;
+ trans_state = XPAND_TRANS_ROLLBACK_STMT;
DBUG_RETURN(0);
}
-void clustrix_connection::auto_commit_next()
+void xpand_connection::auto_commit_next()
{
- trans_flags |= CLUSTRIX_TRANS_AUTOCOMMIT;
+ trans_flags |= XPAND_TRANS_AUTOCOMMIT;
}
-void clustrix_connection::auto_commit_closed()
+void xpand_connection::auto_commit_closed()
{
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT) {
- trans_flags &= ~CLUSTRIX_TRANS_AUTOCOMMIT;
- trans_state = CLUSTRIX_TRANS_NONE;
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT) {
+ trans_flags &= ~XPAND_TRANS_AUTOCOMMIT;
+ trans_state = XPAND_TRANS_NONE;
}
}
-int clustrix_connection::run_query(String &stmt)
+int xpand_connection::run_query(String &stmt)
{
- int error_code = mysql_real_query(&clustrix_net, stmt.ptr(), stmt.length());
+ int error_code = mysql_real_query(&xpand_net, stmt.ptr(), stmt.length());
if (error_code)
- return mysql_errno(&clustrix_net);
+ return mysql_errno(&xpand_net);
return error_code;
}
-int clustrix_connection::write_row(ulonglong clustrix_table_oid,
+int xpand_connection::write_row(ulonglong xpand_table_oid,
uchar *packed_row, size_t packed_size,
ulonglong *last_insert_id)
{
@@ -385,13 +385,13 @@ int clustrix_connection::write_row(ulonglong clustrix_table_oid,
command_length = 0;
// row based commands should not be called with auto commit.
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT)
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT)
return HA_ERR_INTERNAL_ERROR;
- if ((error_code = begin_command(CLUSTRIX_WRITE_ROW)))
+ if ((error_code = begin_command(XPAND_WRITE_ROW)))
return error_code;
- if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
+ if ((error_code = add_command_operand_ulonglong(xpand_table_oid)))
return error_code;
if ((error_code = add_command_operand_str(packed_row, packed_size)))
@@ -403,11 +403,11 @@ int clustrix_connection::write_row(ulonglong clustrix_table_oid,
if ((error_code = read_query_response()))
return error_code;
- *last_insert_id = clustrix_net.insert_id;
+ *last_insert_id = xpand_net.insert_id;
return error_code;
}
-int clustrix_connection::key_update(ulonglong clustrix_table_oid,
+int xpand_connection::key_update(ulonglong xpand_table_oid,
uchar *packed_key, size_t packed_key_length,
MY_BITMAP *update_set,
uchar *packed_new_data,
@@ -417,13 +417,13 @@ int clustrix_connection::key_update(ulonglong clustrix_table_oid,
command_length = 0;
// row based commands should not be called with auto commit.
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT)
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT)
return HA_ERR_INTERNAL_ERROR;
- if ((error_code = begin_command(CLUSTRIX_KEY_UPDATE)))
+ if ((error_code = begin_command(XPAND_KEY_UPDATE)))
return error_code;
- if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
+ if ((error_code = add_command_operand_ulonglong(xpand_table_oid)))
return error_code;
if ((error_code = add_command_operand_str(packed_key, packed_key_length)))
@@ -445,20 +445,20 @@ int clustrix_connection::key_update(ulonglong clustrix_table_oid,
return error_code;
}
-int clustrix_connection::key_delete(ulonglong clustrix_table_oid,
+int xpand_connection::key_delete(ulonglong xpand_table_oid,
uchar *packed_key, size_t packed_key_length)
{
int error_code;
command_length = 0;
// row based commands should not be called with auto commit.
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT)
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT)
return HA_ERR_INTERNAL_ERROR;
- if ((error_code = begin_command(CLUSTRIX_KEY_DELETE)))
+ if ((error_code = begin_command(XPAND_KEY_DELETE)))
return error_code;
- if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
+ if ((error_code = add_command_operand_ulonglong(xpand_table_oid)))
return error_code;
if ((error_code = add_command_operand_str(packed_key, packed_key_length)))
@@ -473,8 +473,8 @@ int clustrix_connection::key_delete(ulonglong clustrix_table_oid,
return error_code;
}
-int clustrix_connection::key_read(ulonglong clustrix_table_oid, uint index,
- clustrix_lock_mode_t lock_mode,
+int xpand_connection::key_read(ulonglong xpand_table_oid, uint index,
+ xpand_lock_mode_t lock_mode,
MY_BITMAP *read_set, uchar *packed_key,
ulong packed_key_length, uchar **rowdata,
ulong *rowdata_length)
@@ -483,13 +483,13 @@ int clustrix_connection::key_read(ulonglong clustrix_table_oid, uint index,
command_length = 0;
// row based commands should not be called with auto commit.
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT)
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT)
return HA_ERR_INTERNAL_ERROR;
- if ((error_code = begin_command(CLUSTRIX_KEY_READ)))
+ if ((error_code = begin_command(XPAND_KEY_READ)))
return error_code;
- if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
+ if ((error_code = add_command_operand_ulonglong(xpand_table_oid)))
return error_code;
if ((error_code = add_command_operand_uint(index)))
@@ -507,27 +507,27 @@ int clustrix_connection::key_read(ulonglong clustrix_table_oid, uint index,
if ((error_code = send_command()))
return error_code;
- ulong packet_length = cli_safe_read(&clustrix_net);
+ ulong packet_length = cli_safe_read(&xpand_net);
if (packet_length == packet_error)
- return mysql_errno(&clustrix_net);
+ return mysql_errno(&xpand_net);
- uchar *data = clustrix_net.net.read_pos;
+ uchar *data = xpand_net.net.read_pos;
*rowdata_length = safe_net_field_length_ll(&data, packet_length);
*rowdata = (uchar *)my_malloc(*rowdata_length, MYF(MY_WME));
memcpy(*rowdata, data, *rowdata_length);
- packet_length = cli_safe_read(&clustrix_net);
+ packet_length = cli_safe_read(&xpand_net);
if (packet_length == packet_error) {
my_free(*rowdata);
*rowdata = NULL;
*rowdata_length = 0;
- return mysql_errno(&clustrix_net);
+ return mysql_errno(&xpand_net);
}
return 0;
}
-class clustrix_connection_cursor {
+class xpand_connection_cursor {
struct rowdata {
ulong length;
uchar *data;
@@ -537,7 +537,7 @@ class clustrix_connection_cursor {
ulong last_row;
struct rowdata *rows;
uchar *outstanding_row; // to be freed on next request.
- MYSQL *clustrix_net;
+ MYSQL *xpand_net;
public:
ulong buffer_size;
@@ -547,7 +547,7 @@ public:
private:
int cache_row(uchar *rowdata, ulong rowdata_length)
{
- DBUG_ENTER("clustrix_connection_cursor::cache_row");
+ DBUG_ENTER("xpand_connection_cursor::cache_row");
rows[last_row].length = rowdata_length;
rows[last_row].data = (uchar *)my_malloc(rowdata_length, MYF(MY_WME));
if (!rows[last_row].data)
@@ -559,11 +559,11 @@ private:
int load_rows_impl(bool *stmt_completed)
{
- DBUG_ENTER("clustrix_connection_cursor::load_rows_impl");
+ DBUG_ENTER("xpand_connection_cursor::load_rows_impl");
int error_code = 0;
- ulong packet_length = cli_safe_read(clustrix_net);
+ ulong packet_length = cli_safe_read(xpand_net);
if (packet_length == packet_error) {
- error_code = mysql_errno(clustrix_net);
+ error_code = mysql_errno(xpand_net);
*stmt_completed = TRUE;
if (error_code == HA_ERR_END_OF_FILE) {
// We have read all rows for query.
@@ -573,7 +573,7 @@ private:
DBUG_RETURN(error_code);
}
- uchar *rowdata = clustrix_net->net.read_pos;
+ uchar *rowdata = xpand_net->net.read_pos;
ulong rowdata_length = safe_net_field_length_ll(&rowdata, packet_length);
if (!rowdata_length) {
// We have read all rows in this batch.
@@ -587,10 +587,10 @@ private:
}
public:
- clustrix_connection_cursor(MYSQL *clustrix_net_, ulong bufsize)
+ xpand_connection_cursor(MYSQL *xpand_net_, ulong bufsize)
{
- DBUG_ENTER("clustrix_connection_cursor::clustrix_connection_cursor");
- clustrix_net = clustrix_net_;
+ DBUG_ENTER("xpand_connection_cursor::xpand_connection_cursor");
+ xpand_net = xpand_net_;
eof_reached = FALSE;
current_row = 0;
last_row = 0;
@@ -600,9 +600,9 @@ public:
DBUG_VOID_RETURN;
}
- ~clustrix_connection_cursor()
+ ~xpand_connection_cursor()
{
- DBUG_ENTER("clustrix_connection_cursor::~clustrix_connection_cursor");
+ DBUG_ENTER("xpand_connection_cursor::~xpand_connection_cursor");
if (outstanding_row)
my_free(outstanding_row);
if (rows) {
@@ -615,7 +615,7 @@ public:
int load_rows(bool *stmt_completed)
{
- DBUG_ENTER("clustrix_connection_cursor::load_rows");
+ DBUG_ENTER("xpand_connection_cursor::load_rows");
current_row = 0;
last_row = 0;
DBUG_RETURN(load_rows_impl(stmt_completed));
@@ -623,14 +623,14 @@ public:
int initialize(bool *stmt_completed)
{
- DBUG_ENTER("clustrix_connection_cursor::initialize");
- ulong packet_length = cli_safe_read(clustrix_net);
+ DBUG_ENTER("xpand_connection_cursor::initialize");
+ ulong packet_length = cli_safe_read(xpand_net);
if (packet_length == packet_error) {
*stmt_completed = TRUE;
- DBUG_RETURN(mysql_errno(clustrix_net));
+ DBUG_RETURN(mysql_errno(xpand_net));
}
- unsigned char *pos = clustrix_net->net.read_pos;
+ unsigned char *pos = xpand_net->net.read_pos;
scan_refid = safe_net_field_length_ll(&pos, packet_length);
rows = (struct rowdata *)my_malloc(buffer_size * sizeof(struct rowdata),
@@ -643,7 +643,7 @@ public:
uchar *retrieve_row(ulong *rowdata_length)
{
- DBUG_ENTER("clustrix_connection_cursor::retrieve_row");
+ DBUG_ENTER("xpand_connection_cursor::retrieve_row");
if (outstanding_row) {
my_free(outstanding_row);
outstanding_row = NULL;
@@ -657,11 +657,11 @@ public:
}
};
-int clustrix_connection::allocate_cursor(MYSQL *clustrix_net, ulong buffer_size,
- clustrix_connection_cursor **scan)
+int xpand_connection::allocate_cursor(MYSQL *xpand_net, ulong buffer_size,
+ xpand_connection_cursor **scan)
{
- DBUG_ENTER("clustrix_connection::allocate_cursor");
- *scan = new clustrix_connection_cursor(clustrix_net, buffer_size);
+ DBUG_ENTER("xpand_connection::allocate_cursor");
+ *scan = new xpand_connection_cursor(xpand_net, buffer_size);
if (!*scan)
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
@@ -678,25 +678,25 @@ int clustrix_connection::allocate_cursor(MYSQL *clustrix_net, ulong buffer_size,
DBUG_RETURN(error_code);
}
-int clustrix_connection::scan_table(ulonglong clustrix_table_oid,
- clustrix_lock_mode_t lock_mode,
+int xpand_connection::scan_table(ulonglong xpand_table_oid,
+ xpand_lock_mode_t lock_mode,
MY_BITMAP *read_set, ushort row_req,
- clustrix_connection_cursor **scan)
+ xpand_connection_cursor **scan)
{
int error_code;
command_length = 0;
// row based commands should not be called with auto commit.
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT)
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT)
return HA_ERR_INTERNAL_ERROR;
- if ((error_code = begin_command(CLUSTRIX_SCAN_TABLE)))
+ if ((error_code = begin_command(XPAND_SCAN_TABLE)))
return error_code;
if ((error_code = add_command_operand_ushort(row_req)))
return error_code;
- if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
+ if ((error_code = add_command_operand_ulonglong(xpand_table_oid)))
return error_code;
if ((error_code = add_command_operand_uchar((uchar)lock_mode)))
@@ -708,7 +708,7 @@ int clustrix_connection::scan_table(ulonglong clustrix_table_oid,
if ((error_code = send_command()))
return error_code;
- return allocate_cursor(&clustrix_net, row_req, scan);
+ return allocate_cursor(&xpand_net, row_req, scan);
}
/**
@@ -728,17 +728,17 @@ int clustrix_connection::scan_table(ulonglong clustrix_table_oid,
* scan_refid id used to reference this scan later
* Used in pushdowns to initiate query scan.
**/
-int clustrix_connection::scan_query(String &stmt, uchar *fieldtype, uint fields,
+int xpand_connection::scan_query(String &stmt, uchar *fieldtype, uint fields,
uchar *null_bits, uint null_bits_size,
uchar *field_metadata,
uint field_metadata_size,
ushort row_req,
- clustrix_connection_cursor **scan)
+ xpand_connection_cursor **scan)
{
int error_code;
command_length = 0;
- if ((error_code = begin_command(CLUSTRIX_SCAN_QUERY)))
+ if ((error_code = begin_command(XPAND_SCAN_QUERY)))
return error_code;
if ((error_code = add_command_operand_ushort(row_req)))
@@ -760,7 +760,7 @@ int clustrix_connection::scan_query(String &stmt, uchar *fieldtype, uint fields,
if ((error_code = send_command()))
return error_code;
- return allocate_cursor(&clustrix_net, row_req, scan);
+ return allocate_cursor(&xpand_net, row_req, scan);
}
/**
@@ -774,13 +774,13 @@ int clustrix_connection::scan_query(String &stmt, uchar *fieldtype, uint fields,
* dbname current working database
* dbname &current database name
**/
-int clustrix_connection::update_query(String &stmt, LEX_CSTRING &dbname,
+int xpand_connection::update_query(String &stmt, LEX_CSTRING &dbname,
ulonglong *affected_rows)
{
int error_code;
command_length = 0;
- if ((error_code = begin_command(CLUSTRIX_UPDATE_QUERY)))
+ if ((error_code = begin_command(XPAND_UPDATE_QUERY)))
return error_code;
if ((error_code = add_command_operand_str((uchar*)dbname.str, dbname.length)))
@@ -794,33 +794,33 @@ int clustrix_connection::update_query(String &stmt, LEX_CSTRING &dbname,
error_code = read_query_response();
if (!error_code)
- *affected_rows = clustrix_net.affected_rows;
+ *affected_rows = xpand_net.affected_rows;
return error_code;
}
-int clustrix_connection::scan_from_key(ulonglong clustrix_table_oid, uint index,
- clustrix_lock_mode_t lock_mode,
+int xpand_connection::scan_from_key(ulonglong xpand_table_oid, uint index,
+ xpand_lock_mode_t lock_mode,
enum scan_type scan_dir,
int no_key_cols, bool sorted_scan,
MY_BITMAP *read_set, uchar *packed_key,
ulong packed_key_length, ushort row_req,
- clustrix_connection_cursor **scan)
+ xpand_connection_cursor **scan)
{
int error_code;
command_length = 0;
// row based commands should not be called with auto commit.
- if (trans_flags & CLUSTRIX_TRANS_AUTOCOMMIT)
+ if (trans_flags & XPAND_TRANS_AUTOCOMMIT)
return HA_ERR_INTERNAL_ERROR;
- if ((error_code = begin_command(CLUSTRIX_SCAN_FROM_KEY)))
+ if ((error_code = begin_command(XPAND_SCAN_FROM_KEY)))
return error_code;
if ((error_code = add_command_operand_ushort(row_req)))
return error_code;
- if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
+ if ((error_code = add_command_operand_ulonglong(xpand_table_oid)))
return error_code;
if ((error_code = add_command_operand_uint(index)))
@@ -847,10 +847,10 @@ int clustrix_connection::scan_from_key(ulonglong clustrix_table_oid, uint index,
if ((error_code = send_command()))
return error_code;
- return allocate_cursor(&clustrix_net, row_req, scan);
+ return allocate_cursor(&xpand_net, row_req, scan);
}
-int clustrix_connection::scan_next(clustrix_connection_cursor *scan,
+int xpand_connection::scan_next(xpand_connection_cursor *scan,
uchar **rowdata, ulong *rowdata_length)
{
*rowdata = scan->retrieve_row(rowdata_length);
@@ -863,7 +863,7 @@ int clustrix_connection::scan_next(clustrix_connection_cursor *scan,
int error_code;
command_length = 0;
- if ((error_code = begin_command(CLUSTRIX_SCAN_NEXT)))
+ if ((error_code = begin_command(XPAND_SCAN_NEXT)))
return error_code;
if ((error_code = add_command_operand_ushort(scan->buffer_size)))
@@ -889,7 +889,7 @@ int clustrix_connection::scan_next(clustrix_connection_cursor *scan,
return 0;
}
-int clustrix_connection::scan_end(clustrix_connection_cursor *scan)
+int xpand_connection::scan_end(xpand_connection_cursor *scan)
{
int error_code;
command_length = 0;
@@ -900,7 +900,7 @@ int clustrix_connection::scan_end(clustrix_connection_cursor *scan)
if (eof_reached)
return 0;
- if ((error_code = begin_command(CLUSTRIX_SCAN_STOP)))
+ if ((error_code = begin_command(XPAND_SCAN_STOP)))
return error_code;
if ((error_code = add_command_operand_lcb(scan_refid)))
@@ -912,7 +912,7 @@ int clustrix_connection::scan_end(clustrix_connection_cursor *scan)
return read_query_response();
}
-int clustrix_connection::populate_table_list(LEX_CSTRING *db,
+int xpand_connection::populate_table_list(LEX_CSTRING *db,
handlerton::discovered_list *result)
{
int error_code = 0;
@@ -921,15 +921,15 @@ int clustrix_connection::populate_table_list(LEX_CSTRING *db,
stmt.append(db);
stmt.append(" WHERE table_type = 'BASE TABLE'");
- if (mysql_real_query(&clustrix_net, stmt.c_ptr(), stmt.length())) {
- int error_code = mysql_errno(&clustrix_net);
+ if (mysql_real_query(&xpand_net, stmt.c_ptr(), stmt.length())) {
+ int error_code = mysql_errno(&xpand_net);
if (error_code == ER_BAD_DB_ERROR)
return 0;
else
return error_code;
}
- MYSQL_RES *results = mysql_store_result(&clustrix_net);
+ MYSQL_RES *results = mysql_store_result(&xpand_net);
if (mysql_num_fields(results) != 2) {
error_code = HA_ERR_CORRUPT_EVENT;
goto error;
@@ -944,11 +944,11 @@ error:
return error_code;
}
-int clustrix_connection::discover_table_details(LEX_CSTRING *db,
+int xpand_connection::discover_table_details(LEX_CSTRING *db,
LEX_CSTRING *name, THD *thd,
TABLE_SHARE *share)
{
- DBUG_ENTER("clustrix_connection::discover_table_details");
+ DBUG_ENTER("xpand_connection::discover_table_details");
int error_code = 0;
MYSQL_RES *results_oid = NULL;
MYSQL_RES *results_create = NULL;
@@ -965,15 +965,15 @@ int clustrix_connection::discover_table_details(LEX_CSTRING *db,
get_oid.append(name);
get_oid.append("'");
- if (mysql_real_query(&clustrix_net, get_oid.c_ptr(), get_oid.length())) {
- if ((error_code = mysql_errno(&clustrix_net))) {
+ if (mysql_real_query(&xpand_net, get_oid.c_ptr(), get_oid.length())) {
+ if ((error_code = mysql_errno(&xpand_net))) {
DBUG_PRINT("mysql_real_query returns ", ("%d", error_code));
error_code = HA_ERR_NO_SUCH_TABLE;
goto error;
}
}
- results_oid = mysql_store_result(&clustrix_net);
+ results_oid = mysql_store_result(&xpand_net);
DBUG_PRINT("oid results",
("rows: %llu, fields: %u", mysql_num_rows(results_oid),
mysql_num_fields(results_oid)));
@@ -1001,15 +1001,15 @@ int clustrix_connection::discover_table_details(LEX_CSTRING *db,
show.append(db);
show.append(".");
show.append(name);
- if (mysql_real_query(&clustrix_net, show.c_ptr(), show.length())) {
- if ((error_code = mysql_errno(&clustrix_net))) {
+ if (mysql_real_query(&xpand_net, show.c_ptr(), show.length())) {
+ if ((error_code = mysql_errno(&xpand_net))) {
DBUG_PRINT("mysql_real_query returns ", ("%d", error_code));
error_code = HA_ERR_NO_SUCH_TABLE;
goto error;
}
}
- results_create = mysql_store_result(&clustrix_net);
+ results_create = mysql_store_result(&xpand_net);
DBUG_PRINT("show table results",
("rows: %llu, fields: %u", mysql_num_rows(results_create),
mysql_num_fields(results_create)));
@@ -1041,7 +1041,7 @@ error:
#define COMMAND_BUFFER_SIZE_INCREMENT 1024
#define COMMAND_BUFFER_SIZE_INCREMENT_BITS 10
-int clustrix_connection::expand_command_buffer(size_t add_length)
+int xpand_connection::expand_command_buffer(size_t add_length)
{
size_t expanded_length;
@@ -1066,7 +1066,7 @@ int clustrix_connection::expand_command_buffer(size_t add_length)
return 0;
}
-int clustrix_connection::add_command_operand_uchar(uchar value)
+int xpand_connection::add_command_operand_uchar(uchar value)
{
int error_code = expand_command_buffer(sizeof(value));
if (error_code)
@@ -1078,7 +1078,7 @@ int clustrix_connection::add_command_operand_uchar(uchar value)
return 0;
}
-int clustrix_connection::add_command_operand_ushort(ushort value)
+int xpand_connection::add_command_operand_ushort(ushort value)
{
ushort be_value = htobe16(value);
int error_code = expand_command_buffer(sizeof(be_value));
@@ -1090,7 +1090,7 @@ int clustrix_connection::add_command_operand_ushort(ushort value)
return 0;
}
-int clustrix_connection::add_command_operand_uint(uint value)
+int xpand_connection::add_command_operand_uint(uint value)
{
uint be_value = htobe32(value);
int error_code = expand_command_buffer(sizeof(be_value));
@@ -1102,7 +1102,7 @@ int clustrix_connection::add_command_operand_uint(uint value)
return 0;
}
-int clustrix_connection::add_command_operand_ulonglong(ulonglong value)
+int xpand_connection::add_command_operand_ulonglong(ulonglong value)
{
ulonglong be_value = htobe64(value);
int error_code = expand_command_buffer(sizeof(be_value));
@@ -1114,7 +1114,7 @@ int clustrix_connection::add_command_operand_ulonglong(ulonglong value)
return 0;
}
-int clustrix_connection::add_command_operand_lcb(ulonglong value)
+int xpand_connection::add_command_operand_lcb(ulonglong value)
{
int len = net_length_size(value);
int error_code = expand_command_buffer(len);
@@ -1126,7 +1126,7 @@ int clustrix_connection::add_command_operand_lcb(ulonglong value)
return 0;
}
-int clustrix_connection::add_command_operand_str(const uchar *str,
+int xpand_connection::add_command_operand_str(const uchar *str,
size_t str_length)
{
int error_code = add_command_operand_lcb(str_length);
@@ -1156,7 +1156,7 @@ int clustrix_connection::add_command_operand_str(const uchar *str,
* str - string to send
* str_length - size
**/
-int clustrix_connection::add_command_operand_vlstr(const uchar *str,
+int xpand_connection::add_command_operand_vlstr(const uchar *str,
size_t str_length)
{
int error_code = expand_command_buffer(str_length);
@@ -1168,12 +1168,12 @@ int clustrix_connection::add_command_operand_vlstr(const uchar *str,
return 0;
}
-int clustrix_connection::add_command_operand_lex_string(LEX_CSTRING str)
+int xpand_connection::add_command_operand_lex_string(LEX_CSTRING str)
{
return add_command_operand_str((const uchar *)str.str, str.length);
}
-int clustrix_connection::add_command_operand_bitmap(MY_BITMAP *bitmap)
+int xpand_connection::add_command_operand_bitmap(MY_BITMAP *bitmap)
{
int error_code = add_command_operand_lcb(bitmap->n_bits);
if (error_code)
diff --git a/storage/clustrixdb/clustrix_connection.h b/storage/xpand/xpand_connection.h
index f2a48f3da6c..c07d8da5f5b 100644
--- a/storage/clustrixdb/clustrix_connection.h
+++ b/storage/xpand/xpand_connection.h
@@ -2,8 +2,8 @@
Copyright (c) 2019, MariaDB Corporation.
*****************************************************************************/
-#ifndef _clustrix_connection_h
-#define _clustrix_connection_h
+#ifndef _xpand_connection_h
+#define _xpand_connection_h
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
@@ -19,34 +19,34 @@ Copyright (c) 2019, MariaDB Corporation.
#include "my_bitmap.h"
#include "handler.h"
-#define CLUSTRIX_SERVER_REQUEST 30
+#define XPAND_SERVER_REQUEST 30
-typedef enum clustrix_lock_mode {
- CLUSTRIX_NO_LOCKS,
- CLUSTRIX_SHARED,
- CLUSTRIX_EXCLUSIVE,
-} clustrix_lock_mode_t;
+typedef enum xpand_lock_mode {
+ XPAND_NO_LOCKS,
+ XPAND_SHARED,
+ XPAND_EXCLUSIVE,
+} xpand_lock_mode_t;
-class clustrix_connection_cursor;
-class clustrix_connection
+class xpand_connection_cursor;
+class xpand_connection
{
private:
- MYSQL clustrix_net;
+ MYSQL xpand_net;
uchar *command_buffer;
size_t command_buffer_length;
size_t command_length;
int trans_state;
int trans_flags;
- int allocate_cursor(MYSQL *clustrix_net, ulong buffer_size,
- clustrix_connection_cursor **scan);
+ int allocate_cursor(MYSQL *xpand_net, ulong buffer_size,
+ xpand_connection_cursor **scan);
public:
- clustrix_connection();
- ~clustrix_connection();
+ xpand_connection();
+ ~xpand_connection();
inline bool is_connected()
{
- return clustrix_net.net.vio;
+ return xpand_net.net.vio;
}
int connect();
void disconnect(bool is_destructor = FALSE);
@@ -61,16 +61,16 @@ public:
void auto_commit_closed();
int run_query(String &stmt);
- int write_row(ulonglong clustrix_table_oid, uchar *packed_row,
+ int write_row(ulonglong xpand_table_oid, uchar *packed_row,
size_t packed_size, ulonglong *last_insert_id);
- int key_update(ulonglong clustrix_table_oid,
+ int key_update(ulonglong xpand_table_oid,
uchar *packed_key, size_t packed_key_length,
MY_BITMAP *update_set,
uchar *packed_new_data, size_t packed_new_length);
- int key_delete(ulonglong clustrix_table_oid,
+ int key_delete(ulonglong xpand_table_oid,
uchar *packed_key, size_t packed_key_length);
- int key_read(ulonglong clustrix_table_oid, uint index,
- clustrix_lock_mode_t lock_mode, MY_BITMAP *read_set,
+ int key_read(ulonglong xpand_table_oid, uint index,
+ xpand_lock_mode_t lock_mode, MY_BITMAP *read_set,
uchar *packed_key, ulong packed_key_length, uchar **rowdata,
ulong *rowdata_length);
enum sort_order {SORT_NONE = 0, SORT_ASC = 1, SORT_DESC = 2};
@@ -82,24 +82,24 @@ public:
READ_FROM_START, /* rows with forwards from first key. */
READ_FROM_LAST, /* rows with backwards from last key. */
};
- int scan_table(ulonglong clustrix_table_oid,
- clustrix_lock_mode_t lock_mode,
+ int scan_table(ulonglong xpand_table_oid,
+ xpand_lock_mode_t lock_mode,
MY_BITMAP *read_set, ushort row_req,
- clustrix_connection_cursor **scan);
+ xpand_connection_cursor **scan);
int scan_query(String &stmt, uchar *fieldtype, uint fields, uchar *null_bits,
uint null_bits_size, uchar *field_metadata,
uint field_metadata_size, ushort row_req,
- clustrix_connection_cursor **scan);
+ xpand_connection_cursor **scan);
int update_query(String &stmt, LEX_CSTRING &dbname, ulonglong *affected_rows);
- int scan_from_key(ulonglong clustrix_table_oid, uint index,
- clustrix_lock_mode_t lock_mode,
+ int scan_from_key(ulonglong xpand_table_oid, uint index,
+ xpand_lock_mode_t lock_mode,
enum scan_type scan_dir, int no_key_cols, bool sorted_scan,
MY_BITMAP *read_set, uchar *packed_key,
ulong packed_key_length, ushort row_req,
- clustrix_connection_cursor **scan);
- int scan_next(clustrix_connection_cursor *scan, uchar **rowdata,
+ xpand_connection_cursor **scan);
+ int scan_next(xpand_connection_cursor *scan, uchar **rowdata,
ulong *rowdata_length);
- int scan_end(clustrix_connection_cursor *scan);
+ int scan_end(xpand_connection_cursor *scan);
int populate_table_list(LEX_CSTRING *db, handlerton::discovered_list *result);
int discover_table_details(LEX_CSTRING *db, LEX_CSTRING *name, THD *thd,
@@ -120,4 +120,4 @@ private:
int send_command();
int read_query_response();
};
-#endif // _clustrix_connection_h
+#endif // _xpand_connection_h