Copy date formats when cloning handle (#326)

Fix date format for odbc handles get reset to default date format
for backend when handle is cloned
This commit is contained in:
Nyall Dawson
2021-08-19 12:08:07 +10:00
committed by GitHub
parent 33b9dfa52f
commit cfbca2af03

View File

@@ -315,6 +315,11 @@ MdbHandle *mdb_clone_handle(MdbHandle *mdb)
mdb_iconv_init(newmdb);
mdb_set_default_backend(newmdb, mdb->backend_name);
// date formats for the source handle may have been changed from
// the backend's default formats, so we need to explicitly copy them here
mdb_set_date_fmt(newmdb, mdb->date_fmt);
mdb_set_shortdate_fmt(newmdb, mdb->shortdate_fmt);
if (mdb->f) {
mdb->f->refs++;
}