Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 02/25/2016
Components: Database
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF2016_Final /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
Related Bugs:
CF-4138764 - Similar to
Two issues:
1) CAST(myBitColumn AS VARCHAR) returns YES/NO instead of 1/0
2) a) LOWER(CAST(myVarcharColumn AS VARCHAR)) returns Foo instead of foo; b) UPPER(CAST(myVarcharColumn AS VARCHAR)) returns Foo instead of FOO
First, define DSN and create table:
--------------------------------------------
myDSN = "";
queryExecute("CREATE TABLE myTable (myBitColumn bit NULL, myVarcharColumn varchar(3) NULL)", [], {datasource=myDSN});
queryExecute("INSERT INTO myTable VALUES (1, 'Foo')", [], {datasource=myDSN});
Repro for #1:
--------------------------------------------
q1 = queryExecute("SELECT CAST(myBitColumn AS VARCHAR) AS myVarcharColumn FROM myTable", [], {datasource=myDSN});
q2 = queryExecute("SELECT myBitColumn FROM myTable", [], {datasource=myDSN});
q3 = queryExecute("SELECT CAST(myBitColumn AS VARCHAR) AS myVarcharColumn FROM q2", [], {dbtype="query"});
writeOutput(q1.myVarcharColumn & ' ' & q3.myVarcharColumn);
//Actual result: 1 YES
//Expected result: 1 1
Repro for #2a:
--------------------------------------------
q3 = queryExecute("SELECT LOWER(CAST(myVarcharColumn AS VARCHAR)) AS myVarcharColumn FROM myTable", [], {datasource=myDSN});
q4 = queryExecute("SELECT myVarcharColumn FROM myTable", [], {datasource=myDSN});
q5 = queryExecute("SELECT LOWER(CAST(myVarcharColumn AS VARCHAR)) AS myVarcharColumn FROM q4", [], {dbtype="query"});
writeOutput(q3.myVarcharColumn & ' ' & q5.myVarcharColumn);
//Actual result: foo Foo
//Expected result: foo foo
Repro for #2b:
--------------------------------------------
Same as repro for #2a, except change "LOWER" to "UPPER"
//Actual result: FOO Foo
//Expected result: FOO FOO
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4121934
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: