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

interface conversion: interface {} is int64, not uint64 #25956

Closed
hawkingrei opened this issue Jul 5, 2021 · 1 comment · Fixed by #26010
Closed

interface conversion: interface {} is int64, not uint64 #25956

hawkingrei opened this issue Jul 5, 2021 · 1 comment · Fixed by #26010
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `expressions_window_employee` (
  `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, 
  `name` varchar(40) NOT NULL, 
  `salary` integer UNSIGNED NOT NULL CHECK (`salary` >= 0), 
  `department` varchar(40) NOT NULL, 
  `hire_date` date NOT NULL, 
  `age` integer NOT NULL, 
  `classification_id` integer NULL, 
  `bonus` numeric(15, 2) NULL
) ;
INSERT INTO expressions_window_employee (name, salary,department,hire_date,age) VALUES ('Miller', 100000, 'Management', now(),40);
INSERT INTO expressions_window_employee (name, salary,department,hire_date,age) VALUES ('Johnson', 80000, 'Management', now(),50);
SELECT 
  `expressions_window_employee`.`id`, 
  `expressions_window_employee`.`name`, 
  `expressions_window_employee`.`salary`, 
  `expressions_window_employee`.`department`, 
  `expressions_window_employee`.`hire_date`, 
  `expressions_window_employee`.`age`, 
  `expressions_window_employee`.`classification_id`, 
  `expressions_window_employee`.`bonus`, 
  MIN(
    `expressions_window_employee`.`salary`
  ) OVER (
    PARTITION BY `expressions_window_employee`.`department` 
    ORDER BY 
      `expressions_window_employee`.`salary` ASC, 
      `expressions_window_employee`.`name` ASC
  ) AS `min_salary` 
FROM 
  `expressions_window_employee` 
ORDER BY 
  `expressions_window_employee`.`department` ASC, 
  `expressions_window_employee`.`salary` ASC, 
  `expressions_window_employee`.`name` ASC

2. What did you expect to see? (Required)

+----+-----------+--------+------------+------------+-----+-------------------+--------+------------+
| id | name      | salary | department | hire_date  | age | classification_id | bonus  | min_salary |
+----+-----------+--------+------------+------------+-----+-------------------+--------+------------+
| 1  | Williams  | 37000  | Accounting | 2021-07-05 | 20  | <null>            | <null> | 37000      |
| 2  | Jenson    | 45000  | Accounting | 2021-07-05 | 20  | <null>            | <null> | 37000      |
| 3  | Adams     | 50000  | Accounting | 2021-07-05 | 50  | <null>            | <null> | 37000      |
| 9  | Moore     | 34000  | IT         | 2021-07-05 | 40  | <null>            | <null> | 34000      |
| 8  | Wilkinson | 60000  | IT         | 2021-07-05 | 40  | <null>            | <null> | 34000      |
| 11 | Johnson   | 80000  | Management | 2021-07-05 | 50  | <null>            | <null> | 80000      |
| 10 | Miller    | 100000 | Management | 2021-07-05 | 40  | <null>            | <null> | 80000      |
| 7  | Smith     | 38000  | Marketing  | 2021-07-05 | 20  | <null>            | <null> | 38000      |
| 6  | Johnson   | 40000  | Marketing  | 2021-07-05 | 30  | <null>            | <null> | 38000      |
| 5  | Brown     | 53000  | Sales      | 2021-07-05 | 30  | <null>            | <null> | 53000      |
| 4  | Smith     | 55000  | Sales      | 2021-07-05 | 30  | <null>            | <null> | 53000      |
+----+-----------+--------+------------+------------+-----+-------------------+--------+------------+

3. What did you see instead (Required)

(1105, 'interface conversion: interface {} is int64, not uint64')

"interface conversion: interface {} is int64, not uint64\ngithub.com/pingcap/tidb/executor.(*recordSet).Next.func1\n\t/Users/hawkingrei/devel/opensource/tidb/executor/adapter.go:141\nruntime.gopanic\n\t/usr/local/Cellar/go/1.16.5/libexec/src/runtime/panic.go:965\nruntime.panicdottypeE\n\t/usr/local/Cellar/go/1.16.5/libexec/src/runtime/iface.go:261\ngithub.com/pingcap/tidb/executor/aggfuncs.(*maxMin4UintSliding).UpdatePartialResult\n\t/Users/hawkingrei/devel/opensource/tidb/executor/aggfuncs/func_max_min.go:477\ngithub.com/pingcap/tidb/executor.(*PipelinedWindowExec).produce\n\t/Users/hawkingrei/devel/opensource/tidb/executor/pipelined_window.go:392\ngithub.com/pingcap/tidb/executor.(*PipelinedWindowExec).Next\n\t/Users/hawkingrei/devel/opensource/tidb/executor/pipelined_window.go:149\ngithub.com/pingcap/tidb/executor.Next\n\t/Users/hawkingrei/devel/opensource/tidb/executor/executor.go:286\ngithub.com/pingcap/tidb/executor.(*recordSet).Next\n\t/Users/hawkingrei/devel/opensource/tidb/executor/adapter.go:145\ngithub.com/pingcap/tidb/server.(*tidbResultSet).Next\n\t/Users/hawkingrei/devel/opensource/tidb/server/driver_tidb.go:305\ngithub.com/pingcap/tidb/server.(*clientConn).writeChunks\n\t/Users/hawkingrei/devel/opensource/tidb/server/conn.go:1875\ngithub.com/pingcap/tidb/server.(*clientConn).writeResultset\n\t/Users/hawkingrei/devel/opensource/tidb/server/conn.go:1823\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmt\n\t/Users/hawkingrei/devel/opensource/tidb/server/conn.go:1717\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery\n\t/Users/hawkingrei/devel/opensource/tidb/server/conn.go:1563\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch\n\t/Users/hawkingrei/devel/opensource/tidb/server/conn.go:1097\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/Users/hawkingrei/devel/opensource/tidb/server/conn.go:860\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/Users/hawkingrei/devel/opensource/tidb/server/server.go:485\nruntime.goexit\n\t/usr/local/Cellar/go/1.16.5/libexec/src/runtime/asm_amd64.s:1371

4. What is your TiDB version? (Required)

master

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Jul 5, 2021
@hawkingrei hawkingrei changed the title interface conversion: interface {} is int64, not uint64 in Django test interface conversion: interface {} is int64, not uint64 Jul 5, 2021
newcworld pushed a commit to newcworld/tidb that referenced this issue Jul 7, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants