Hi,
I'm facing issue in views due to this bug https://bugs.mysql.com/bug.php?id=61131.
While publishing datastore I'm gettting error (The data source schema does not match the type mappings: Wrong column type in XXXXXXX_View for column XXXXX. Found: tinyint, expected: boolean (APNX-2-4056-000)).
I don't want to change Appian datatype as there're many dependents. Is there any solution from database perspective to change those columns back from tinyint(4) to tinyint(1).
Thanks in advance.
Discussion posts and replies are publicly visible
Hello Riyazs,
So, I understand you still have a boolean value in that field it is just converted to a tinyint(4).
you cannot use the cast because tinyint is not allowed but can you create a new view and a function?
From the link you refer they are creating this:
- create or replace view la_luis_view2 as select * from la_luis_view1 union all select * as X from la_luis_view1;
I will rewrite it like this:
- create or replace view la_luis_view2 as select especie_de_boolean from la_luis_view1 union all select especie_de_boolean as X from la_luis_view1;
then create the following
DELIMITER $$ CREATE FUNCTION `IntToTinyInt1`(TheInt tinyint) RETURNS tinyint(1) -- here is the trick DETERMINISTIC BEGIN RETURN TheInt; END$$ DELIMITER ; create or replace view la_luis_view3 as select IntToTinyInt1(especie_de_boolean) from la_luis_view2; desc la_luis_view3;
(If you want to see the thread https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html#function_convert)
Jose
I thought you already had it and/or you didn't wanted to touch the CDTs!!
this is Great!! I am glad you found the problem!