Affected Products & Versions:
BioStar 2.6.2~2.7.10 MSSQL version

Summary
BioStar 2 zone status shows 'Unknown' even if all devices in the zone are connected to BioStar 2.

In the BioStar 2 system log, you will see some query errors as below.


9/12/06 12:02:11.129589 E <SYS> [0x000016c0] Cannot execute the command:


UPDATE T_ZN AS ZN SET ZN.STA = CASE WHEN

(SELECT COUNT * FROM (

(SELECT Z.ZNUID, Z.STA ZS, D.DEVID, D.STA DS FROM T_ZN Z

JOIN T_ETRDEVS ED ON Z.ZNUID = ED.ZNUID

JOIN T_DEV D ON ED.DEVUID = D.DEVID)

UNION

(SELECT Z.ZNUID, Z.STA ZS, D.DEVID, D.STA DS FROM T_ZN Z

JOIN T_ZNFALINPSNS INP ON Z.ZNUID = INP.ZNUID

JOIN T_DEV D ON INP.INPDEVID = D.DEVID)

UNION

(SELECT Z.ZNUID, Z.STA ZS, D.DEVID, D.STA DS FROM T_ZN Z

JOIN T_FALDRS FDR ON Z.ZNUID = FDR.ZNUID

JOIN T_DR DR ON FDR.DRUID = DR.DRUID

JOIN T_DEV D ON DR.INSDEVUID = D.DEVID OR DR.OUSDEVUID = D.DEVID OR DR.RELDEVIDX = D.DEVID OR DR.SNSDEVIDX = D.DEVID)

UNION

(SELECT Z.ZNUID, Z.STA ZS, D.DEVID, D.STA DS FROM T_ZN Z

JOIN T_EXDEVS EX ON Z.ZNUID = EX.ZNUID

JOIN T_DEV D ON EX.DEVUID = D.DEVID)

) AS U

WHERE ZNUID = 32769 AND DS = 0) > 0

THEN (ZN.STA | 64) ELSE (ZN.STA & ~(64)) END

WHERE ZN.ZNUID = 32769


Error code=102

Incorrect syntax near '>'.

Incorrect syntax near the keyword 'AS'.



CauseĀ 

MSSQL query error


Solution

BioStar 2.7.11 upgrade