summaryrefslogtreecommitdiff
path: root/storage/csv
diff options
context:
space:
mode:
Diffstat (limited to 'storage/csv')
-rw-r--r--storage/csv/Makefile.am4
-rw-r--r--storage/csv/ha_tina.cc12
2 files changed, 6 insertions, 10 deletions
diff --git a/storage/csv/Makefile.am b/storage/csv/Makefile.am
index 07ffac88a96..3a00ae85e20 100644
--- a/storage/csv/Makefile.am
+++ b/storage/csv/Makefile.am
@@ -32,12 +32,12 @@ noinst_HEADERS = ha_tina.h transparent_file.h
EXTRA_LTLIBRARIES = ha_csv.la
pkglib_LTLIBRARIES = @plugin_csv_shared_target@
ha_csv_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
-ha_csv_la_CXXFLAGS = $(AM_CFLAGS) -DMYSQL_PLUGIN
+ha_csv_la_CXXFLAGS = $(AM_CXXFLAGS) -DMYSQL_PLUGIN
ha_csv_la_SOURCES = transparent_file.cc ha_tina.cc
EXTRA_LIBRARIES = libcsv.a
noinst_LIBRARIES = @plugin_csv_static_target@
-libcsv_a_CXXFLAGS = $(AM_CFLAGS)
+libcsv_a_CXXFLAGS = $(AM_CXXFLAGS)
libcsv_a_SOURCES = transparent_file.cc ha_tina.cc
EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 4a9754922e5..15a8d0bf0f0 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -468,7 +468,7 @@ int ha_tina::encode_quote(uchar *buf)
const char *ptr;
const char *end_ptr;
const bool was_null= (*field)->is_null();
-
+
/*
assistance for backwards compatibility in production builds.
note: this will not work for ENUM columns.
@@ -480,7 +480,7 @@ int ha_tina::encode_quote(uchar *buf)
}
(*field)->val_str(&attribute,&attribute);
-
+
if (was_null)
(*field)->set_null();
@@ -498,34 +498,30 @@ int ha_tina::encode_quote(uchar *buf)
buffer.append('"');
- while (ptr < end_ptr)
+ for (; ptr < end_ptr; ptr++)
{
if (*ptr == '"')
{
buffer.append('\\');
buffer.append('"');
- *ptr++;
}
else if (*ptr == '\r')
{
buffer.append('\\');
buffer.append('r');
- *ptr++;
}
else if (*ptr == '\\')
{
buffer.append('\\');
buffer.append('\\');
- *ptr++;
}
else if (*ptr == '\n')
{
buffer.append('\\');
buffer.append('n');
- *ptr++;
}
else
- buffer.append(*ptr++);
+ buffer.append(*ptr);
}
buffer.append('"');
}