MySQL++

Check-in [de38699272]
Login

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

Overview
Comment:Experimental fix for [eab08a87ed]: copy the list of successfully applied connection options when cloning a Connection and its underlying DBDriver so that the copy gets the same options. We currently only do this when the other connection was up at the time of cloning, but we might be swayed to change this behavior.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | reapply-conn-opts-on-clone
Files: files | file ages | folders
SHA3-256:de3869927217ca1cfa46d6b6c4addbe3c9dacf35594d1bf6b04b84dad84e613d
User & Date: tangent 2018-07-12 21:21:01
Context
2018-07-12
21:21
Experimental fix for [eab08a87ed]: copy the list of successfully applied connection options when cloning a Connection and its underlying DBDriver so that the copy gets the same options. We currently only do this when the other connection was up at the time of cloning, but we might be swayed to change this behavior. Leaf check-in: de38699272 user: tangent tags: reapply-conn-opts-on-clone
20:05
Conditionally using std::unique_ptr instead of auto_ptr on C++11 and newer versions of g++ and clang++ to avoid the warning about using a deprecated feature. Closes [97f62ef016]. check-in: 08496d4b48 user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/dbdriver.cpp.

127
128
129
130
131
132
133



134






135
136
137
138
139
140
141
void
DBDriver::copy(const DBDriver& other)
{
	if (connected()) {
		disconnect();
	}




	if (other.connected()) {






		connect(other.mysql_);
	}
}


void
DBDriver::disconnect()







>
>
>

>
>
>
>
>
>







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
void
DBDriver::copy(const DBDriver& other)
{
	if (connected()) {
		disconnect();
	}

	applied_options_.clear();
	pending_options_.clear();

	if (other.connected()) {
		pending_options_.resize(other.applied_options_.size());
		for (OptionList::const_iterator it = other.applied_options_.begin();
				it != other.applied_options_.end(); ++it) {
			pending_options_.push_back(*it);
		}

		connect(other.mysql_);
	}
}


void
DBDriver::disconnect()