Skip to content

Error while renaming column #2429

Open
Open
@mauvm

Description

When trying to rename a DOUBLE column an exception occurs:

CREATE TABLE `01234` (
  `foo` double(8,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE 01234 CHANGE foo bar DOUBLE PRECISION DEFAULT NULL;
-- Error in query (1064): Syntax error near '01234 CHANGE foo bar DOUBLE PRECISION DEFAULT NULL' at line 1 

So there are two problems here:

  1. The table and column names aren't escaped, which causes problems for table names like "01234"
  2. The DOUBLE precision of 8,2 is lost

This query works as expected (equal to the query for creating the column):

ALTER TABLE `01234` CHANGE `foo` `bar` DOUBLE(8,2) DEFAULT NULL;
-- OK

I'm assuming the problems lies in the DBAL package and not in Lumen 5.2 (or Laravel).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions