How to solve “Query failed” error in drush sql-sync output 2?
At the time of writing this comment, there is a problem in drush 9 with php7.4 as mentioned here: https://github.com/drush-ops/drush/issues/4319#issuecomment-649223069
I solved it in my case (I have multiple PHP versions installed) by switching to php7.2 using this command:
sudo update-alternatives --set php /usr/bin/php7.2
I think it will work also with php7.0 and php7.1