Field Database type Double does not install #847

Closed
opened 2021-12-31 16:05:40 +00:00 by linpi1 · 4 comments
linpi1 commented 2021-12-31 16:05:40 +00:00 (Migrated from github.com)

Steps to reproduce the issue

add a field with the Database type double
in the tab Database, it is mandatory to enter a field size.

Expected result

install / upgrade the component

Actual result

It is not possible to install the component.
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 ') NOT NULL DEFAULT 0 AFTER name' at line 1
SQL =
ALTER TABLE #__demo_look ADD COLUMN number DOUBLE(100) NOT NULL DEFAULT 0 AFTER name;

System information (as much as possible)

  • OS Name & Version: MacOS Catalina
  • MySql Version: 5.7.34 - MySQL (Mamp Pro 6.6)
  • Apache Version: Apache/2.4.46
  • PHP Version: 7.4.21
  • Joomla Version: 2.10.4
  • JCB Version: 2.12.14
  • Browser: Firefox 91.4.1

Additional comments

by removing (100) after the DOUBLE, the component installs.

### Steps to reproduce the issue add a field with the Database type double in the tab Database, it is mandatory to enter a field size. ### Expected result install / upgrade the component ### Actual result It is not possible to install the component. 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 ') NOT NULL DEFAULT 0 AFTER `name`' at line 1 SQL = ALTER TABLE `#__demo_look` ADD COLUMN `number` DOUBLE(100) NOT NULL DEFAULT 0 AFTER `name`; ### System information (as much as possible) - OS Name & Version: MacOS Catalina - MySql Version: 5.7.34 - MySQL (Mamp Pro 6.6) - Apache Version: Apache/2.4.46 - PHP Version: 7.4.21 - Joomla Version: 2.10.4 - JCB Version: 2.12.14 - Browser: Firefox 91.4.1 ### Additional comments by removing (100) after the DOUBLE, the component installs.

Seems like a limitation in JCB, we are only making provision for one number, and it seems like there is two needed, or none. Honestly I have never used it, just added it and well your the first to give legitimate feedback, so thanks.

Can you check what happens it you have two numbers like

ALTER TABLE #__demo_look ADD COLUMN number DOUBLE(100, 10) NOT NULL DEFAULT 0 AFTER name;

Then seeing it is an ALTER TABLE statement, you know you can update this in JCB... I mean the ALTER statement. But sure we should push the DOUBLE setting a bit further to work as expected... so let me know.

Seems like a limitation in JCB, we are only making provision for one number, and it seems like there is [two needed](https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html), or none. Honestly I have never used it, just added it and well your the first to give legitimate feedback, so thanks. Can you check what happens it you have two numbers like ``` ALTER TABLE #__demo_look ADD COLUMN number DOUBLE(100, 10) NOT NULL DEFAULT 0 AFTER name; ``` Then seeing it is an ALTER TABLE statement, you know you can update this in JCB... I mean the ALTER statement. But sure we should push the DOUBLE setting a bit further to work as expected... so let me know.

An apologies for the slow replay... as always to much on my plate 👍

An apologies for the slow replay... as always to much on my plate :+1:
linpi1 commented 2022-02-04 15:48:40 +00:00 (Migrated from github.com)

this time I'm sorry that I replay only know, but thank you for replaying. I tried with double (100,4) and it works perfectly. I guess I could have taken less bytes, like double (16,4) and it would have work as well in my example.

this time I'm sorry that I replay only know, but thank you for replaying. I tried with double (100,4) and it works perfectly. I guess I could have taken less bytes, like double (16,4) and it would have work as well in my example.

Okay I take it this is resolved...

Okay I take it this is resolved...
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#847
No description provided.