Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The results of executing sql contained ”group by columnName=“ is not consistent with MYSQL #3177

Open
jndxcaiwei opened this issue Mar 10, 2022 · 0 comments
Labels
limitation Known limitations wontfix

Comments

@jndxcaiwei
Copy link
Member

  • dble version:
    3.21.10.0

  • configs:

sharding.xml

<shardingTable name="Employee" shardingNode="dn3,dn4" function="func_hashString" shardingColumn="deptname"/>

<function name="func_hashString" class="StringHash">
      <property name="partitionCount">2</property>
      <property name="partitionLength">1</property>
      <property name="hashSlice">0:2</property>
  </function>
  • steps:
    step1. create table:
   CREATE TABLE `Employee` (
  `name` varchar(250) NOT NULL,
  `empid` int(11) NOT NULL,
  `deptname` varchar(250) NOT NULL,
  `level` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

step2. prepare data:

insert into Employee values('Harry',3415,'Finance','P7'),('Sally',2242,'Sales','P7'),('George',3401,'Finance','P8'),('Harriet',2202,'Sales','P8'),('Mary',1257,'Human Resources','P7'),('LiLi',9527,'Human Resources','P9'),('Tom',7012,'Market','P9'),('Tony',3052,'Market','P10'),('Jessi',7948,'Finance','P8');

step3. execute SQL:

select deptname,count(*) from Employee group by deptname='Human Resources';
  • MYSQL result:
+-----------------+----------+
| deptname        | count(*) |
+-----------------+----------+
| Finance         |        7 |
| Human Resources |        2 |
+-----------------+----------+
  • dble result:
+-----------------+----------+
| deptname        | count(*) |
+-----------------+----------+
| Sales           |        7 |
| Human Resources |        2 |
+-----------------+----------+
@LUAgam LUAgam added the limitation Known limitations label Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
limitation Known limitations wontfix
Projects
None yet
Development

No branches or pull requests

3 participants