Bug report: wrong table sorting

LutzT posted 2 months ago in General

How to reproduce:

  1. execute the commands below
  2. select database HeidiSQL_bugreport at left panel
  3. go to right panel and order tables by name
  4. you will find, that tables are not order alphabetically (see screenshot attached) image description
DROP DATABASE  HeidiSQL_bugreport;
CREATE DATABASE HeidiSQL_bugreport;
CREATE TABLE HeidiSQL_bugreport.`40AB_Abc` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
CREATE TABLE HeidiSQL_bugreport.`2SN_beta` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
CREATE TABLE HeidiSQL_bugreport.`2SN100_beta` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
CREATE TABLE HeidiSQL_bugreport.`2SN100_gamma_3` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
CREATE TABLE HeidiSQL_bugreport.`2SN100_alpha_1` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
CREATE TABLE HeidiSQL_bugreport.`lorem` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
CREATE TABLE HeidiSQL_bugreport.`ipsum` (
    `dummy` VARCHAR(32) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
;
1 attachment(s):
  • HeidiSQL_bugreport
ansgar posted 2 months ago

Seems my sorting algorithm removes non-digits from names which start with a digit. If you do that virtually here, the names look as follows:

  • 2
  • 40
  • 2100
  • 21001
  • 21003
  • ipsum
  • lorem

This is of course wrong.

Nice reproduction recipe by the way!

Could you post this in the tracker please?

LutzT posted 2 months ago

Ticket raised: https://github.com/HeidiSQL/HeidiSQL/issues/570

Please login to leave a reply, or register at first.