summaryrefslogtreecommitdiff
path: root/storage/csv
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2007-01-11 22:15:20 +0300
committerunknown <kostja@bodhi.local>2007-01-11 22:15:20 +0300
commitc1bcbe2973c2c3a4054635bac4a787ca06758c05 (patch)
treee4e6b520180358f870a1eeddcb51c8da437e1b44 /storage/csv
parentbd27fcf8438a53d88ff292d955c13253a916b349 (diff)
parent5ed3d05e4078032f44d74c116919d2a0ec4aa550 (diff)
downloadmariadb-git-c1bcbe2973c2c3a4054635bac4a787ca06758c05.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.local:/opt/local/work/mysql-5.1-runtime mysql-test/t/trigger.test: Auto merged sql/item_func.cc: Auto merged sql/sql_prepare.cc: Auto merged storage/csv/ha_tina.cc: Auto merged mysql-test/r/csv.result: Manual merge. mysql-test/t/csv.test: Manual merge.
Diffstat (limited to 'storage/csv')
-rw-r--r--storage/csv/ha_tina.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 0818b915618..afe8e5f1b27 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -469,14 +469,16 @@ int ha_tina::encode_quote(byte *buf)
const char *end_ptr;
/*
- Write an empty string to the buffer in case of a NULL value.
+ CSV does not support nulls. Write quoted 0 to the buffer. In fact,
+ (*field)->val_str(&attribute,&attribute) would usually return 0
+ in this case but we write it explicitly here.
Basically this is a safety check, as no one ensures that the
field content is cleaned up every time we use Field::set_null()
in the code.
*/
if ((*field)->is_null())
{
- buffer.append(STRING_WITH_LEN("\"\","));
+ buffer.append(STRING_WITH_LEN("\"0\","));
continue;
}