libtabula

Check-in [f8610afda3]
Login

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

Overview
Comment:Fixed an operator precedence complaint in the new field type matching code noticed by Clang.
Timelines: family | ancestors | descendants | both | mysql-type-info
Files: files | file ages | folders
SHA1: f8610afda340f1435e6643b33eabbeb3007dfec0
User & Date: tangent 2015-08-14 03:43:52
Context
2015-08-14
03:55
Merged trunk changes in check-in: f2cdede2a0 user: tangent tags: mysql-type-info
03:43
Fixed an operator precedence complaint in the new field type matching code noticed by Clang. check-in: f8610afda3 user: tangent tags: mysql-type-info
2015-08-13
21:52
Fixed the quoted NULL value problem. The code wasn't checking for null values explicitly when building query strings, it was only checking the attributes of the data type. That is, it might ask something like, "Should sql_text_null be quoted", get "yes", and quote the value when building SQL query strings even when the value is a SQL NULL, and thus needs to go literally into the generated SQL.

MySQL++ must have gotten away without such code by playing some kind of game with the field type. This is a better way to do it.

Incidentally, this marks the first version of this branch that runs dtest to completion without diffs! A bit of cleanup, and we can merge it back into the trunk! check-in: e32649510e user: etr tags: mysql-type-info

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/field_type.cpp.

250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
		if (base_type_ == cand.base_type_) {
			// Found a possible match.
			if (flags_ == cand.flags_) {
				// It's a good match, but is it the best?
				guess = i;
				if (cand.best_guess_) return cand;
			}
			else if (cand.flags_ & flags_ == cand.flags_) {
				// All flags on the candidate are present in the
				// caller's value, so keep this one in mind, but
				// don't go with it unless we find no better option.
				guess = i;
			}
			// else, it's only a weak match; hold out for better
		}







|







250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
		if (base_type_ == cand.base_type_) {
			// Found a possible match.
			if (flags_ == cand.flags_) {
				// It's a good match, but is it the best?
				guess = i;
				if (cand.best_guess_) return cand;
			}
			else if ((cand.flags_ & flags_) == cand.flags_) {
				// All flags on the candidate are present in the
				// caller's value, so keep this one in mind, but
				// don't go with it unless we find no better option.
				guess = i;
			}
			// else, it's only a weak match; hold out for better
		}