usql updates

This commit is contained in:
2021-10-11 17:24:44 +02:00
parent 4a074e9ba3
commit 91f1a8b6c7
5 changed files with 22 additions and 189 deletions

View File

@@ -1,4 +1,6 @@
#include <errno.h>
#include "exception.h"
#include "csvreader.h"
#include "parser.h"
@@ -30,9 +32,10 @@ int CsvReader::parseCSV(const std::string &filename, std::vector<ColDefNode> &co
std::vector<std::string> line;
line.reserve(32);
errno = 0;
FILE* fp = fopen(filename.c_str(), "r");
if (fp == NULL)
exit(EXIT_FAILURE);
throw Exception("load from csv, cannot read from file(" + std::to_string(errno) + ")");
char* line_str = NULL;
size_t len = 0;