Some fixes for the postgresql branch
-
Support complete postgresql URIs (I only tested with TCP)
-
Fix an ASAN error:
[DEBUG]: src/database/postgresql_engine.cpp:101: body: SELECT column_name from information_schema.columns where table_name='muclogline_' [DEBUG]: src/database/postgresql_engine.cpp:112: PGRES_TUPLES_OK [DEBUG]: src/database/postgresql_engine.cpp:45: found 9 columns. ================================================================= ==4252==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x60800000ba20 in thread T0: object passed to delete has wrong type: size of the allocated type: 96 bytes; size of the deallocated type: 8 bytes. #0 0x7ffff6f017f0 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc37f0) #1 0x5555560e3492 in std::default_delete<Statement>::operator()(Statement*) const /usr/include/c++/6/bits/unique_ptr.h:76 #2 0x5555560d9d4c in std::unique_ptr<Statement, std::default_delete<Statement> >::~unique_ptr() /usr/include/c++/6/bits/unique_ptr.h:239 #3 0x5555563a148b in PostgresqlEngine::get_all_columns_from_table(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/biboumi/src/database/postgresql_engine.cpp:39 #4 0x555556336df5 in Table<Id, Database::Uuid, Database::Owner, Database::IrcChanName, Database::IrcServerName, Database::Date, Database::Body, Database::Nick>::upgrade(DatabaseEngine&) /opt/biboumi/src/database/table.hpp:60 #5 0x55555631af7e in Database::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/biboumi/src/database/database.cpp:47 #6 0x555555fd25f1 in open_database() /opt/biboumi/src/utils/reload.cpp:14 #7 0x555555f9fb3d in main /opt/biboumi/src/main.cpp:92 #8 0x7ffff4fa62b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) #9 0x555555f9d589 in _start (/usr/bin/biboumi+0xa49589) 0x60800000ba20 is located 0 bytes inside of 96-byte region [0x60800000ba20,0x60800000ba80) allocated by thread T0 here: #0 0x7ffff6f00bf0 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc2bf0) #1 0x5555563aed6f in std::_MakeUniq<PostgresqlStatement>::__single_object std::make_unique<PostgresqlStatement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pg_conn* const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pg_conn* const&) /usr/include/c++/6/bits/unique_ptr.h:791 #2 0x5555563a1c3b in PostgresqlEngine::prepare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/biboumi/src/database/postgresql_engine.cpp:61 #3 0x5555563a0ff7 in PostgresqlEngine::get_all_columns_from_table(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/biboumi/src/database/postgresql_engine.cpp:39 #4 0x555556336df5 in Table<Id, Database::Uuid, Database::Owner, Database::IrcChanName, Database::IrcServerName, Database::Date, Database::Body, Database::Nick>::upgrade(DatabaseEngine&) /opt/biboumi/src/database/table.hpp:60 #5 0x55555631af7e in Database::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/biboumi/src/database/database.cpp:47 #6 0x555555fd25f1 in open_database() /opt/biboumi/src/utils/reload.cpp:14 #7 0x555555f9fb3d in main /opt/biboumi/src/main.cpp:92 #8 0x7ffff4fa62b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)