Issue Details (XML | Word | Printable)

Key: CORE-5167
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Alex Bekhtin
Votes: 0
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Allow implicit conversion between boolean and string

Created: 24/Mar/16 10:16 AM   Updated: 30/Apr/16 05:24 PM
Component/s: Engine
Affects Version/s: 3.0 RC2
Fix Version/s: 3.0.1, 4.0 Alpha 1

QA Status: Done successfully
Test Details: Checked on WI-T4.0.0.141; WI-V3.0.0.32490


 Description  « Hide
Edited subject to say about the more general case - Adriano.

select '' || cast( 1 as SMALLINT ) from rdb$database;
select '' || cast( 1 as INTEGER ) from rdb$database;
select '' || cast( 1 as BIGINT ) from rdb$database;
select '' || cast( TRUE as BOOLEAN ) from rdb$database; -- Overflow occurred during data type conversion.
                                                        -- conversion error from string "BOOLEAN".
select '' || cast( 1.1 as FLOAT ) from rdb$database;
select '' || cast( 1.1 as DOUBLE PRECISION ) from rdb$database;
select '' || cast( 1.1 as NUMERIC(3,3) ) from rdb$database;
select '' || cast( 1.1 as DECIMAL(3,3) ) from rdb$database;
select '' || cast( '2015-01-01' as DATE ) from rdb$database;
select '' || cast( '10:51:59' as TIME ) from rdb$database;
select '' || cast( '2015-01-01 10:51:59' as TIMESTAMP ) from rdb$database;
select '' || cast( 'char text' as CHAR(20) ) from rdb$database;
select '' || cast( 'varchar text' as VARCHAR(20) ) from rdb$database;
select '' || cast( 'blob text' as BLOB ) from rdb$database;

select cast( TRUE as varchar(20) ) from rdb$database; -- works fine


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes made changes - 28/Mar/16 03:25 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Pavel Cisar made changes - 29/Mar/16 08:05 AM
Status Resolved [ 5 ] Closed [ 6 ]
Sean Leyne made changes - 31/Mar/16 01:32 PM
Resolution Won't Fix [ 2 ]
Status Closed [ 6 ] Reopened [ 4 ]
Adriano dos Santos Fernandes made changes - 31/Mar/16 04:31 PM
Summary Automatic boolean values convertation with string concatenation Allow implicit conversion of boolean values to string
Issue Type Bug [ 1 ] Improvement [ 4 ]
Description select '' || cast( 1 as SMALLINT ) from rdb$database;
select '' || cast( 1 as INTEGER ) from rdb$database;
select '' || cast( 1 as BIGINT ) from rdb$database;
select '' || cast( TRUE as BOOLEAN ) from rdb$database; -- Overflow occurred during data type conversion.
                                                        -- conversion error from string "BOOLEAN".
select '' || cast( 1.1 as FLOAT ) from rdb$database;
select '' || cast( 1.1 as DOUBLE PRECISION ) from rdb$database;
select '' || cast( 1.1 as NUMERIC(3,3) ) from rdb$database;
select '' || cast( 1.1 as DECIMAL(3,3) ) from rdb$database;
select '' || cast( '2015-01-01' as DATE ) from rdb$database;
select '' || cast( '10:51:59' as TIME ) from rdb$database;
select '' || cast( '2015-01-01 10:51:59' as TIMESTAMP ) from rdb$database;
select '' || cast( 'char text' as CHAR(20) ) from rdb$database;
select '' || cast( 'varchar text' as VARCHAR(20) ) from rdb$database;
select '' || cast( 'blob text' as BLOB ) from rdb$database;

select cast( TRUE as varchar(20) ) from rdb$database; -- works fine
Edited subject to say about the more general case - Adriano.

select '' || cast( 1 as SMALLINT ) from rdb$database;
select '' || cast( 1 as INTEGER ) from rdb$database;
select '' || cast( 1 as BIGINT ) from rdb$database;
select '' || cast( TRUE as BOOLEAN ) from rdb$database; -- Overflow occurred during data type conversion.
                                                        -- conversion error from string "BOOLEAN".
select '' || cast( 1.1 as FLOAT ) from rdb$database;
select '' || cast( 1.1 as DOUBLE PRECISION ) from rdb$database;
select '' || cast( 1.1 as NUMERIC(3,3) ) from rdb$database;
select '' || cast( 1.1 as DECIMAL(3,3) ) from rdb$database;
select '' || cast( '2015-01-01' as DATE ) from rdb$database;
select '' || cast( '10:51:59' as TIME ) from rdb$database;
select '' || cast( '2015-01-01 10:51:59' as TIMESTAMP ) from rdb$database;
select '' || cast( 'char text' as CHAR(20) ) from rdb$database;
select '' || cast( 'varchar text' as VARCHAR(20) ) from rdb$database;
select '' || cast( 'blob text' as BLOB ) from rdb$database;

select cast( TRUE as varchar(20) ) from rdb$database; -- works fine
Assignee Adriano dos Santos Fernandes [ asfernandes ]
Fix Version/s 4.0 Alpha 1 [ 10731 ]
Adriano dos Santos Fernandes made changes - 04/Apr/16 05:35 PM
Summary Allow implicit conversion of boolean values to string Allow implicit conversion between boolean and string
Component/s Engine [ 10000 ]
Adriano dos Santos Fernandes made changes - 04/Apr/16 06:18 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Pavel Zotov made changes - 11/Apr/16 12:47 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status No test Deferred
Pavel Zotov made changes - 16/Apr/16 08:58 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status Deferred
Pavel Zotov made changes - 22/Apr/16 12:49 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status Done successfully
Pavel Zotov made changes - 22/Apr/16 12:49 PM
Status Resolved [ 5 ] Closed [ 6 ]
Pavel Zotov made changes - 23/Apr/16 07:04 AM
Status Closed [ 6 ] Closed [ 6 ]
Test Details Checked on WI-T4.0.0.141; WI-V3.0.0.32490
Dmitry Yemanov made changes - 30/Apr/16 05:24 PM
Fix Version/s 3.0.1 [ 10730 ]