[BISERVER-11687] The following unexpected error has occurred during adding fields to the IR: "The generated SQL-query did not execute successfully".
(cherry picked from commit 92b529e)
[BISERVER-11687] The following unexpected error has occurred during adding fields to the IR: "The generated SQL-query did not execute successfully".

Unit test

(cherry picked from commit 92b529e)
Merge pull request #146 from stepanovdg/BISERVER-11687_5.1

[SP-1499][5.1] The following unexpected error has occurred during adding fields to the IR: "The generated SQL-query did not execute successfully".