Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): / ext-user (Nimit Sharma)
Created: 04/12/2016
Components: Database, Query-of-Query(IMQ)
Versions: 2016
Failure Type:
Found In Build/Fixed In Build: 298359 / 303807
Priority/Frequency: Normal / Few users will encounter
Locale/System: English / Linux All,Mac 10 All,Solaris All,Win XP All
Vote Count: 1
Related Bugs:
CF-4121934 - Similar to
Problem: [ANeff] Bug for: QoQ incorrect casting
Original bug #4121934 reported by Aaron Neff
Issue:
CAST(myBitColumn AS VARCHAR) returns YES/NO instead of 1/0
Code Snippet:
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
Method:
Result:
Expected:
Workaround:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4138764
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: