[MDEV-22372] Spider COUNT(*) issues against ColumnStore as one of the Backend Created: 2020-04-27  Updated: 2020-06-05  Resolved: 2020-06-05

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: None
Fix Version/s: 10.5.4

Type: Bug Priority: Major
Reporter: Faisal Saeed (Inactive) Assignee: Kentoku Shiba (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

When executing a simple `SELECT COUNT FROM acct_detail` the queries or any other with agre sent to the backend nodes contains the partition key as one of the columns leading to the error

MariaDB [testdb]> select count(*) from acct_detail;
ERROR 1815 (HY000): Internal error: IDB-2021: '`testdb`.`acct_detail_hist`.`id`' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.

Analyzing the general query log, the output shows the following two queries being executed on the ColumnStore and InnoDB tables

44 Query    select count(0),`id` from `testdb`.`acct_detail_curr`
44 Query    select count(0),`id` from `testdb`.`acct_detail_hist`

Spider node definition as follows:

MariaDB [testdb]> show create table acct_detail\G
*************************** 1. row ***************************
       Table: acct_detail
Create Table: CREATE TABLE `acct_detail` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `c1` varchar(100) DEFAULT NULL,
  `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  UNIQUE KEY `id` (`id`)
) ENGINE=SPIDER AUTO_INCREMENT=274116 DEFAULT CHARSET=latin1 COMMENT='wrapper "mysql", srv "node"'
 PARTITION BY KEY (`id`)
(PARTITION `pt_current` COMMENT = 'table "acct_detail_curr"' ENGINE = SPIDER,
 PARTITION `pt_historic` COMMENT = 'table "acct_detail_hist"' ENGINE = SPIDER)

Thanks.



 Comments   
Comment by Kentoku Shiba (Inactive) [ 2020-04-28 ]

It is not only with ColumnStore. The sql_mode with ONLY_FULL_GROUP_BY is the same behavior.

Comment by Kentoku Shiba (Inactive) [ 2020-04-28 ]

I added a parameter spider_strict_group_by. The values of this parameter means the followings.
-1 : use table parameter
0 : do not strict
1 : do strict

Comment by Kentoku Shiba (Inactive) [ 2020-06-05 ]

backport, build, test and push

Generated at Thu Feb 08 09:14:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.