Skip to content

Extra space added between parentheses when using types such as VARCHAR(10) #1142

@techee

Description

@techee

Details for the issue

Steps to reproduce:

  1. For instance, create a new table Foo with a single field Bar and manually enter the type VARCHAR(10). The IDE correctly executes the following:
CREATE TABLE `Foo` (
	`Bar`	VARCHAR(10)
);
  1. Now select "Modify table". Notice that now the type is displayed as VARCHAR ( 10 ) - notice the spaces around the number - also the SQL command below contains the spaces.

  2. Make some change, e.g. make Bar the primary key and confirm the change. The following SQL is executed:

CREATE TABLE `sqlitebrowser_rename_column_new_table` (
	`Bar`	VARCHAR ( 10 ),
	PRIMARY KEY(`Bar`)
);
  1. Unfortunately the type name is stored together with the spaces and e.g. Delphi then complains that ' 10 ' is not a valid integer.

Just a note why using VARCHAR(N) instead of TEXT - the DbGrid component of Delphi needs the N value to correctly set the widths of columns inside the grid. Simple TEXT makes Delphi show "WideMemo" string instead of the actual value. You can check the type mapping of Delphi here:

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Using_SQLite_with_FireDAC

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: ___ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.10.0
  • 3.10.0-beta*
  • 3.9.1
  • Other: ___

I have also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions