Fatal error in charting a column defined with an SQL scalar function

How to reproduce the bug:

  1. Create a table like this:

CREATE TABLE BIRTHDAY
(
NAME CHAR(50) NOT NULL,
BIRTHDAY DATE NOT NULL
)

  1. Populate the table with few records:

INSERT INTO BIRTHDAY (NAME,BIRTHDAY) VALUES (‘FRED’,‘2/2/1971’)
INSERT INTO BIRTHDAY (NAME,BIRTHDAY) VALUES (‘TOM’, ‘2/2/1971’)
INSERT INTO BIRTHDAY (NAME,BIRTHDAY) VALUES (‘JOHN’,‘2/2/1971’)

  1. Create a grid application on BIRTHDAY table with this sql select clause. This clause computes how many birthdays there are in a month (for the sake of this example the year is not important).

SELECT
MONTH(BIRTHDAY) AS MONTH,
COUNT(*) AS NUMBER_OF_BIRTHDAY
FROM
BIRTHDAY
GROUP BY
MONTH(BIRTHDAY)

  1. Enable charting against NUMBER_OF_BIRTHDAY using MONTH as a label column (see image1 attached)

  2. Generate the app and run. Press the graph icon (see image2 attached) and you will get this error:

Fatal error: Call to undefined function 2() in /opt/NetMake/v81/wwwroot/scriptcase/app/TestBug/grid_BIRTHDAY_1/grid_BIRTHDAY_1_grafico.class.php on line 600

image1.png

image2.png