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');
create table t2 (a int, b int, PRIMARY KEY (a, b));
create table t1 (a int, b int, PRIMARY KEY (a, b)) ENGINE=Spider
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;
MIN(b) a
1 1
2 1
SELECT MAX(b), a FROM t1 WHERE a<3;
MAX(b) a
11 1
......
......@@ -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
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 MAX(b), a FROM t1 WHERE a<3;
......
......@@ -1764,6 +1764,7 @@ typedef struct st_spider_result_list
volatile
#endif
SPIDER_RESULT *current;
MY_BITMAP skip;
KEY *key_info;
int key_order;
spider_string *sqls;
......
......@@ -342,6 +342,15 @@ SPIDER_DBTON spider_dbton_mariadb = {
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(
uint dbton_id
) : spider_db_row(dbton_id),
......@@ -13975,8 +13984,15 @@ int spider_mbase_handler::append_list_item_select(
DBUG_ENTER("spider_mbase_handler::append_list_item_select");
DBUG_PRINT("info",("spider this=%p", this));
begin = str->length();
uint i= -1;
while ((item = it++))
{
i++;
if (item->const_item())
{
bitmap_set_bit(&spider->result_list.skip, i);
continue;
}
if (skip > 0)
{
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