PRSQL9106012: Incorrect Query with COMPUTE May GP-Fault SQL

ID Number: Q73558

1.10

OS/2

buglist1.10

Summary:

Problem ID: PRSQL9106012

SYMPTOMS

Attempting to run a SQL query that includes COMPUTE statements, and

trying to replace the default column heading in the COMPUTE

statements, may GP-fault SQL Server. For example, the following may

cause SQL Server to GP-fault:

SELECT COL1, COL2, COL1*COL1,(COL1+COL1)*1

FROM CRASH

ORDER BY COL1,COL2

COMPUTE

TOTAL1= SUM(COL1*COL1),

TOTAL2= SUM((COL1+COL1)*1)

BY COL1,COL2

CAUSE

Attempting to rename the COMPUTE column headings is syntactically

incorrect. SQL Server should generate a syntax error and reject the

query. Instead, it accepts the syntax and attempts to execute the

query. In instances where a query succeeds, the columns are not

renamed.

RESOLUTION/STATUS

Correct the syntax of the query by removing the attempt to rename

the column headings in the COMPUTE statement. For example:

SELECT COL1, COL2, COL1*COL1,(COL1+COL1)*1

FROM CRASH

ORDER BY COL1,COL2

COMPUTE

SUM(COL1*COL1),

SUM((COL1+COL1)*1)

BY COL1,COL2

Microsoft has confirmed this to be a problem in SQL Server version

1.1. We are researching this problem and will post new information

here as it becomes available.