
Hi Stefan, In your string.out file, you can notice that the NUL character you have inserted isn't present, it has been filtered out. I'm wondering if this is a correct behavior, as from an absolute point of view, all characters have to stored. For the DEL character, the SELECT results from mclient aren't escaped. If you do a sqldump of your test table, you'll see all the control characters escaped but not the DEL character. So, I think an escape case for this character is missing. Sebastien
-----Original Message----- From: users-list [mailto:users-list- bounces+sebastien.raillard=passman.fr@monetdb.org] On Behalf Of Stefan Manegold Sent: jeudi 5 novembre 2015 09:46 To: Communication channel for MonetDB users Subject: Re: Handling of control characters NUL and DEL
Hi Sebastien,
as far as I can tell, if provided literally (i.e., non-escaped), MonetDB treats and stores all characters (i.e., including control characters) literally. Indeed, it's then up to the terminal (or client) how to handle them.
Find attached the output of the following test: ( echo "start transaction; create table t (s string);"; for ((i=0; i<128; i++)) ; do echo "insert into t values('$i: a__'||code($i)||'__z');" ; done ; echo "select * from t; rollback;" ) | mclient > string.out
Best, Stefan
----- On Nov 4, 2015, at 10:43 PM, Sébastien RAILLARD (PASSMAN) sebastien.raillard@passman.fr wrote:
Dear all,
During data validation, we have noticed some strange behavior when working with the control characters NUL (0x00) and DEL (0x7F):
* The NUL character seems to be ignored. For example, if we try to insert in a VARCHAR column this text: 'AB' || CODE(0) || 'CD', the stored value will be 'ABCD'.
* The DEL character isn't escaped when copying data from table to file, whereas all the other control characters (from 0x01 to 0x1F) are correctly escaped. This may produce some display artifacts where the string 'AB' || CODE(127) || 'CD' will be usually displayed as 'ACD'.
Best regards, Sebastien
--
Parc d'activité Tolstoï 4 rue Edouard Aynard 69100 Villeurbanne Tél. +33 (0)4 78 95 05 80 Fax +33 (0)4 78 95 00 17
www.passman.fr www.passman-hotels.com www.passman-camping.com www.passman-sante.com https://www.facebook.com/PASSMAN-187787814053/ _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
-- Parc d'activité Tolstoï 4 rue Edouard Aynard 69100 Villeurbanne Tél. +33 (0)4 78 95 05 80 Fax +33 (0)4 78 95 00 17 www.passman.fr www.passman-hotels.com www.passman-camping.com www.passman-sante.com https://www.facebook.com/PASSMAN-187787814053/