libtabula

Check-in [24d069b506]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:STL on OS X can't cope with vector::at() assignments when the space has only been set aside with vector::reserve(). It wants either a resize() call to set the space aside definitely, or push_back() to extend the vector into the reserved space. (This is probably a sanity check like the old SafeSTL, rather than an actual memory bug, but it has the same effect as a crash.)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:24d069b50697d9c7ffe778a7237960eb3d431854
User & Date: tangent 2015-12-18 22:24:19
Context
2015-12-18
22:42
Removed need for Impl parameter to ResultBase::fetch_row() and its derivatives. ResultBase can provide the implementation object to the DBDriver layer, which is the only code that needed this. check-in: 3f91a82d13 user: tangent tags: trunk
22:24
STL on OS X can't cope with vector::at() assignments when the space has only been set aside with vector::reserve(). It wants either a resize() call to set the space aside definitely, or push_back() to extend the vector into the reserved space. (This is probably a sanity check like the old SafeSTL, rather than an actual memory bug, but it has the same effect as a crash.) check-in: 24d069b506 user: tangent tags: trunk
2015-09-11
19:04
Simplified the C++ feature testing mechanism some check-in: 05f15e2b1c user: etr tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mysql/driver.cpp.

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
	if (MYSQL_ROW raw = mysql_fetch_row(MYSQL_RES_FROM_IMPL(impl))) {
		Row::size_type size = res.num_fields();
		Row::Impl* pd = new Row::Impl;
		pd->reserve(size);
		const unsigned long* lengths = fetch_lengths(impl);
		for (Row::size_type i = 0; i < size; ++i) {
			bool is_null = raw[i] == 0;
			pd->at(i).assign(Row::value_type(
					is_null ? "NULL" : raw[i],
					is_null ? 4 : lengths[i],
					res.field_type(int(i)).base_type(),
					is_null));
		}

		return Row(pd, res.field_names(), throw_exceptions());







|







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
	if (MYSQL_ROW raw = mysql_fetch_row(MYSQL_RES_FROM_IMPL(impl))) {
		Row::size_type size = res.num_fields();
		Row::Impl* pd = new Row::Impl;
		pd->reserve(size);
		const unsigned long* lengths = fetch_lengths(impl);
		for (Row::size_type i = 0; i < size; ++i) {
			bool is_null = raw[i] == 0;
			pd->push_back(Row::value_type(
					is_null ? "NULL" : raw[i],
					is_null ? 4 : lengths[i],
					res.field_type(int(i)).base_type(),
					is_null));
		}

		return Row(pd, res.field_names(), throw_exceptions());