﻿id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
1958	Brittle queries	bewst	bobbysmith007	"I have some ticket_change entries with a blank newvalue field:
{{{
trac=# select author, oldvalue, newvalue from ticket_change where field = 'hours';
 author  | oldvalue | newvalue
---------+----------+----------
 gargol  |          | 12
 gargol  |          | 8
 gargol  |          | 2
 gargol  |          |
 gargol  |          |
 gargol  |          |
 gargol  |          |
 gargol  | 0        | 4
 gargol  | 0        | 7
 gargol  | 0        | 1
 gargol  | 0        | 4
 gargol  |          | 4
 gargol  | 0        | 3
 gargol  | 0        | 5
 gargol  | 0        | 2
 towerx  | 0        | 9
 pcaster | 0        | 16
(17 rows)
}}}

This is causing all the queries to break on {{{CAST(newvalue as DECIMAL)}}} (PostgreSQL):

{{{
ERROR:  invalid input syntax for type numeric: """"
}}}

The simplest workaround I could find was to use  {{{CAST(('0'||newvalue) as DECIMAL)}}} instead.  I'm hardly an SQL expert, though."	defect	closed	normal	TimingAndEstimationPlugin	major	fixed			0.11
