I'm glad I could help you. Sorry if I'm replying after a day. I'll reply with another answer here because it's too long in the comments.
So printf \0 is used to tell bash that the command is finished, a bit like saying ; in programming languages, to mean that the instruction is finished. This happens if you're in bash, while in the MariaDB terminal it returns lines with \n.
While for $NAMELIST it's a Bash problem, not a dialog problem.
For this you need to use options[@], because it allows you to pass each separate element since it's an array.
If you pass it as a string, Bash interprets it as a single value, even if there are spaces.
To give you a practical example to help you understand the concept, I once came across a database with phone numbers.
The problem was that some numbers started with 0, and the computer if you assigned that number as an integer, the 0 cut it, and consequently the number was very wrong.
Example:
Int number = 055333333 —> 55333333
String number = 055333333 —> 055333333
In this case I had to use a string to solve the problem, rightly the 0 in front of a number without a comma, it's as if it wasn't there.
This is an example in reverse, but it's to make you understand how sometimes you have to interpret things differently on the PC.
Sorry for my English. If you have other questions don't hesitate to ask, for now bye bye and good continuation with the script