Commit 75e3c304 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-26345 [debug] some tmp changes to fix

parent a60d7b11
...@@ -10,10 +10,10 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); ...@@ -10,10 +10,10 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (a int, b int, PRIMARY KEY (a, b)); create table t2 (a int, b int, PRIMARY KEY (a, b));
create table t1 (a int, b int, PRIMARY KEY (a, b)) ENGINE=Spider create table t1 (a int, b int, PRIMARY KEY (a, b)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
insert into t1 VALUES (1,1), (1,2), (2,11); insert into t1 VALUES (1,4), (1,2), (2,11);
SELECT MIN(b), a FROM t1 WHERE a=1; SELECT MIN(b), a FROM t1 WHERE a=1;
MIN(b) a MIN(b) a
1 1 2 1
SELECT MAX(b), a FROM t1 WHERE a<3; SELECT MAX(b), a FROM t1 WHERE a<3;
MAX(b) a MAX(b) a
11 1 11 1
......
...@@ -18,7 +18,7 @@ create table t2 (a int, b int, PRIMARY KEY (a, b)); ...@@ -18,7 +18,7 @@ create table t2 (a int, b int, PRIMARY KEY (a, b));
create table t1 (a int, b int, PRIMARY KEY (a, b)) ENGINE=Spider create table t1 (a int, b int, PRIMARY KEY (a, b)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
insert into t1 VALUES (1,1), (1,2), (2,11); insert into t1 VALUES (1,4), (1,2), (2,11);
SELECT MIN(b), a FROM t1 WHERE a=1; SELECT MIN(b), a FROM t1 WHERE a=1;
SELECT MAX(b), a FROM t1 WHERE a<3; SELECT MAX(b), a FROM t1 WHERE a<3;
......
...@@ -1764,6 +1764,7 @@ typedef struct st_spider_result_list ...@@ -1764,6 +1764,7 @@ typedef struct st_spider_result_list
volatile volatile
#endif #endif
SPIDER_RESULT *current; SPIDER_RESULT *current;
MY_BITMAP skip;
KEY *key_info; KEY *key_info;
int key_order; int key_order;
spider_string *sqls; spider_string *sqls;
......
...@@ -342,6 +342,15 @@ SPIDER_DBTON spider_dbton_mariadb = { ...@@ -342,6 +342,15 @@ SPIDER_DBTON spider_dbton_mariadb = {
SPIDER_MATURITY_STABLE SPIDER_MATURITY_STABLE
}; };
void spider_db_mbase_row::skip(MY_BITMAP *map)
{
for (uint i= 0, j= 0; j < field_count; j++)
{
if (!bitmap_is_set(map, j))
row[i++]= row[j];
}
}
spider_db_mbase_row::spider_db_mbase_row( spider_db_mbase_row::spider_db_mbase_row(
uint dbton_id uint dbton_id
) : spider_db_row(dbton_id), ) : spider_db_row(dbton_id),
...@@ -13975,8 +13984,15 @@ int spider_mbase_handler::append_list_item_select( ...@@ -13975,8 +13984,15 @@ int spider_mbase_handler::append_list_item_select(
DBUG_ENTER("spider_mbase_handler::append_list_item_select"); DBUG_ENTER("spider_mbase_handler::append_list_item_select");
DBUG_PRINT("info",("spider this=%p", this)); DBUG_PRINT("info",("spider this=%p", this));
begin = str->length(); begin = str->length();
uint i= -1;
while ((item = it++)) while ((item = it++))
{ {
i++;
if (item->const_item())
{
bitmap_set_bit(&spider->result_list.skip, i);
continue;
}
if (skip > 0) if (skip > 0)
{ {
str->reserve(2); str->reserve(2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment