I have the following SQL file:
SELECT 'N', '\N', CONCAT('\', 'N');
Executing it with mysql <example.sql
outputs:
N N CONCAT('\', 'N')
N \N \N
But executing via source
in the mysql
shell outputs:
+---+----+-------------------+
| N | N | CONCAT('\', 'N') |
+---+----+-------------------+
| N | N | N |
+---+----+-------------------+
The salient difference in output is the N
vs the \N
. Is there a way to get these to be consistent (preferably having \N
output N
)?
What I’m really trying to do is have IFNULL
output N
for null values (and from what I’ve seen, using OUTFILE
doesn’t work across remote connections).