libtabula

Check-in [bd141d86c6]
Login

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

Overview
Comment:The crash that prompted the creation of this branch was due to calling Row.size() before Row was initialized. The old implementation coped with this, but the new one tried to dereference a null pointer to its nonexistent implementation object. Guarding this and a few other paths so we don't try to use that smart pointer if we aren't initialized yet.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bd141d86c650c7de6c297f01e205e489d9c32f24
User & Date: tangent 2015-08-15 09:21:19
Original Comment: The crash that prompted the creation of this branch was due to calling Row.size() before Row was initialized. The old implementation coped with this, but the new one tried to dereference a null pointer to its nonexistent implementation object. Guarding this and a few other paths so we don't try to use that smart pointer if we aren't initialized yet.
Context
2015-08-15
09:35
Merged row-pimpl branch into trunk: moves one of the last few remaining MySQLisms on the trunk down into the MySQLDBDriver layer. check-in: be382a7009 user: tangent tags: trunk
09:32
Merged trunk changes in Closed-Leaf check-in: 4e189f92a7 user: tangent tags: row-pimpl
09:21
The crash that prompted the creation of the row-pimpl branch was due to calling Row.size() before Row was initialized. This old MYSQL_ROW base implementation copes with this, but the new branch will try to dereference a null pointer to its nonexistent implementation object. Guarding this and a few other paths so we don't try to use that smart pointer if we aren't initialized yet.

(This change should have been made on the row-pimpl branch, but it also works against trunk, where it amounts to belt-and-suspenders.) check-in: bd141d86c6 user: tangent tags: trunk

09:15
Documented the method for enabling a debug build on *ix check-in: 2a3b9252e1 user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/row.h.

289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
...
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
	size_type field_num(const char* name) const;

	/// \brief Get a reference to the first element of the vector
	const_reference front() const { return data_.front(); }

	/// \brief Return maximum number of elements that can be stored
	/// in container without resizing.
	size_type max_size() const { return data_.max_size(); }

	/// \brief Assignment operator
	Row& operator =(const Row& rhs)
	{
		data_.assign(rhs.data_.begin(), rhs.data_.end());
		field_names_.assign(rhs.field_names_);
		initialized_ = rhs.initialized_;
................................................................................
	///           // Retreived another row in the result set, can use 'row'
	///       }
	///   }
	/// \endcode
	///
	operator private_bool_type() const
	{
		return data_.size() && initialized_ ? &Row::initialized_ : 0;
	}

	/// \brief Return reverse iterator pointing to first element in the
	/// container
	const_reverse_iterator rbegin() const { return data_.rbegin(); }

	/// \brief Return reverse iterator pointing to one past the last
	/// element in the container
	const_reverse_iterator rend() const { return data_.rend(); }

	/// \brief Get the number of fields in the row.
	size_type size() const { return data_.size(); }

	/// \brief Get a list of the values in this row
	///
	/// When inserted into a C++ stream, the delimiter 'd' will be used
	/// between the items, and the quoting and escaping rules will be
	/// set by the manipulator 'm' you choose.
	///







|







 







|











|







289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
...
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
	size_type field_num(const char* name) const;

	/// \brief Get a reference to the first element of the vector
	const_reference front() const { return data_.front(); }

	/// \brief Return maximum number of elements that can be stored
	/// in container without resizing.
	size_type max_size() const { return initialized_ ? data_.max_size() : 0; }

	/// \brief Assignment operator
	Row& operator =(const Row& rhs)
	{
		data_.assign(rhs.data_.begin(), rhs.data_.end());
		field_names_.assign(rhs.field_names_);
		initialized_ = rhs.initialized_;
................................................................................
	///           // Retreived another row in the result set, can use 'row'
	///       }
	///   }
	/// \endcode
	///
	operator private_bool_type() const
	{
		return initialized_ && data_.size() ? &Row::initialized_ : 0;
	}

	/// \brief Return reverse iterator pointing to first element in the
	/// container
	const_reverse_iterator rbegin() const { return data_.rbegin(); }

	/// \brief Return reverse iterator pointing to one past the last
	/// element in the container
	const_reverse_iterator rend() const { return data_.rend(); }

	/// \brief Get the number of fields in the row.
	size_type size() const { return initialized_ ? data_.size() : 0; }

	/// \brief Get a list of the values in this row
	///
	/// When inserted into a C++ stream, the delimiter 'd' will be used
	/// between the items, and the quoting and escaping rules will be
	/// set by the manipulator 'm' you choose.
	///