I have a column dn
which used to support till varchar(290)
.
Now it should support input till 1024
characters.
As far I know we have a varchar limit till 767
.
I tried changing the variable type to text but I am getting the below error:
mysql> ALTER TABLE `parent1` MODIFY column `dn` text;
ERROR 1170 (42000): BLOB/TEXT column 'dn' used in key specification without a key length
mysql> ALTER TABLE `parent1` MODIFY column `dn` text(1024);
ERROR 1170 (42000): BLOB/TEXT column 'dn' used in key specification without a key length
mysql> ALTER TABLE `parent1` MODIFY column `fdn` longtext(1024);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(1024)' at line 1
Here are the indexes:
> SHOW keys from parent1;
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Index_type | NULL |
| parent1 | 0 | PRIMARY | 1 | parent_id | A | 0 | NULL | NULL | BTREE | |
| parent1 | 0 | id_dn | 1 | id | A | 0 | NULL | NULL | BTREE |
| parent1 | 0 | id_fdn | 2 | dn | A | 0 | NULL | NULL | BTREE