--- a/src/StreamRelationalWriter.h Sat Apr 23 23:23:29 2022 +0200
+++ b/src/StreamRelationalWriter.h Sat Apr 23 23:51:13 2022 +0200
@@ -48,8 +48,8 @@
types::IntegerDataTypeWriter integerWriter;
types::StringDataTypeWriter stringWriter;
std::vector<DataTypeWriterBase*> writers = {&booleanWriter, &integerWriter, &stringWriter};
- BufferingMode bufferingMode = BufferingMode::ENVIRONMENT;
- BufferingMode bufferingModeEnvDefault = BufferingMode::AUTO;
+ BufferingMode bufferingMode;
+ BufferingMode bufferingModeEnvDefault;
/**
* count of columns in the current table
@@ -103,6 +103,7 @@
StreamRelationalWriter(std::ostream &output) :
output(output) {
+ setBufferingMode(BufferingMode::ENVIRONMENT, BufferingMode::AUTO);
}
TypeId toTypeId(const string_t typeCode) override {
@@ -115,8 +116,6 @@
columnCount = attributes.size();
currentColumn = 0;
- updateBufferingMode();
-
// Write table name and column count:
if (writeHeader) {
integerWriter.writeValue(output, DATA_PART_START);
@@ -172,6 +171,7 @@
void setBufferingMode(BufferingMode mode, BufferingMode envDefault) override {
bufferingMode = mode;
bufferingModeEnvDefault = envDefault;
+ updateBufferingMode();
}
};