-
Notifications
You must be signed in to change notification settings - Fork 8
/
ChangeLog
3142 lines (2326 loc) · 132 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
3.2.2, 2015.03.18 (r2780)
o The DBDriver::operator= would leak a live connection if you
assigned a disconnected DBDriver to it. Patch by Quentin Armitage.
o Plugged a potential DBDriver instance leak in Connection ctor.
Patch by Yury Alekseev.
o Explicitly #including algorithm.h in examples/multiquery.cpp for
std::max().
o Added missing "break;" statements in Transaction ctor taking an
isolation level parameter, which caused only the last one to do
the right thing. Problem noticed by Tony Whyman, fix by me.
o The bootstrap script now checks for the existence of needed build
tools before trying to use them. This lets us emit a clearer
error message than the shell will. Original patch by Adrian
Cornish.
o Fixed a build problem related to std::min/max with Visual C++ 2013
due to a change in the definitions provided by its header files.
o Tracked several changes made to Connector/C made since 3.2.1.
o Assorted documentation updates.
o Generating HTML with UTF-8 encoding, not 8859-1
3.2.1, 2013.12.10 (r2756)
o Connection copy ctor wasn't copying the "throw exceptions"
flag. The copy always had exceptions enabled.
o The resetdb example would print a bogus message about logging in
as '1'@'1' instead of showing the actual values passed on the
command line. This did not affect how it actually logged in.
o Previous release tarball was missing a few text files present in
the source repository.
o Updated build paths for VC++ and MinGW to track a file layout
change in Connector/C 6.1.2.
3.2.0, 2013.06.20 (r2747)
o References to MySQL 5.1 have been replaced with 5.6, that
being the current GA release.
o All Windows builds now assume you're using Connector/C 6.1
instead of having installed the MySQL server on your machine
just to get development files. If you are running a MySQL
server on your development machine and don't want to install
Connector/C just to make MySQL++ happy, see the README-*.txt
file for your platform to get instructions on fixing the paths
so the build system finds the development files under the MySQL
server directory.
o The generated VC++ 2008 project files now assume you want 64-bit
executables. (It is 2013 now, after all.)
Since the VC++ 2005 project files continue to be configured for
32-bit builds, the easiest way to get a 32-bit project in VC++
2008+ is to import the VC++ *2005* project files, rather than
adjust the build target settings of all 44 vc2008/*.vcproj
files within the IDE.
See README-Visual-C++.txt for more on this change.
o Added Query::replacefrom(): like insertfrom() but it uses
REPLACE statements instead of INSERT. Patch by Adrian Cornish.
o Added support for SQL "unsigned float" columns. Patch by
Leonardo Lang.
o Added "abicheck" top-level build target, which runs the
ISPRAS ABI checker tool (http://goo.gl/e19lD) against
a predecided "ABI-stable" version of MySQL++, comparing it
against the current version. This should help avoid future
unplanned ABI breakages, as happened between 3.0.9 and 3.1.0.
We have chosen not to revert those changes that broke the ABI,
but instead have chosen to accept the 3.1.0 ABI as the new
stable ABI for the rest of the 3.x series. Running the ABI
checker is now part of the release process, so we should not
change the ABI again until 4.0!
o The Query::insert() and replace() overloads that take a pair
of iterators now work with containers that only provide forward
iterators. Idea by Adrian Cornish.
o Using libtool again on Autotools systems. It gives us
relocatable libraries, which is needed in some linking
situations. Patch by Adrian Cornish.
o VC++ release builds now have optimization enabled. This might
also affect other toolchains that create separate Debug and
Release builds, if Bakefile obeys the directive for those
systems. (Such as, perhaps, Xcode.) Initial patch by Matthew
Bradbury.
o Fixed a crash in CommandLine mechanism when the usage message is
called up for programs that have no "extra" parameter and
corresponding usage appendage. Initial patch by "Crazy Pete".
o Query::storein() now tolerates empty result sets, due either to
DBMS failure or passing a query that never returns results,
such as INSERT.
o Exposed DBDriver::result_empty() as Query::result_empty(). We
did this primarily because it was needed as a helper for the
previous fix, but it could also be useful more broadly.
o Added -Wextra to the pedantic build flags.
o Fixed the "escape" manipulator so it will work with Null<>
wrapped types. Patch by "Kemet".
o ssqls2parse now depends on libmysqlpp. (It wasn't getting
relinked when you changed the library.)
o The configure script's test for the existence of mysql_ssl_set()
got broken by a change in the mysql_loc.m4 test, causing it to
always return "no" even if the platform's MySQL C API library did
have the function. Therefore, the SslOption could never be set.
Fixes this bug: stackoverflow.com/questions/7794408
o Fixed a missing a "buried headers" ifdef wrapper for
type_info.cpp. Patch provided by Xavier Richez.
o We now export the DBDriver class from the MySQL++ DLL when
building on Windows. Client programs can now access it directly,
instead of being able to access only the fields and members
exposed through Connection and Query. Fix suggested by Xavier
Richez.
o MinGW builds no longer require that you manually create an import
library for the MySQL C API DLL from a .def file we provide,
which would inevitably get outdated. We can now link directly to
the DLL, and rely on the MinGW linker to figure out the imports.
o Split the -l flags out of LDFLAGS in the userman's example
Makefiles. They're now in LDLIBS, which causes them to be
put after -o $(EXE) by the default GNU make rules, where they
should be.
o Assorted documentation and build system improvements.
o Assorted fixes for newer GCCs.
3.1.0, 2010.06.03 (r2670)
o Default MySQL version now 5.1, having entered GA since 3.0.9.
o Lots of platform updates tracked, lots of warnings from newer
compilers squished. Most by me, some by Adrian Cornish.
o Added Query::insertfrom(), plus associated classes SQLStream,
NoTransactions, and the InsertPolicy hierarchy. Also adds
examples/ssqls6.cpp, which shows how to use this new feature.
Thanks for this feature go to Rick Gutleber, except for
RowCountInsertPolicy, by me.
o Added comparison operators to tiny_int<T>. Thanks for this patch
go to Edward Diener.
o Added SQLTypeAdapter::is_null(). This lets you retrieve a
nullable column from the DB, then re-insert a value from that
column back into the DB via a template query without explicit
checks for null-ness; it will do the right thing now.
o Added -f flags to lib/*.pl header file generating scripts to
allow overriding the default limit of 25 fields for tqueries
and SSQLSes without having to edit the file, as in previous
versions of MySQL++. Also added --with-field-limit option to
the configure script so you can give both -f options at once
during the build process. This latter is especially useful
for automated binary package builders.
o The file lib/querydef.h (generated by lib/querydef.pl) now
defines the MYSQLPP_TQUERY_MAX_PARAMETERS macro, giving the
maximum number of parameters the functions in the generated file
allow for template queries. Similarly, lib/ssqls.h (generated
by lib/ssqls.pl) defines MYSQLPP_SSQLS_MAX_MEMBERS.
o Added ConnectionPool::safe_grab(), which pings the grabbed
connection before returning it. If the ping fails, we remove
the dead connection from the pool and try again. This doesn't
eliminate the possibility of returning a dead connection;
there is no protection against race conditions. It is merely
a best-effort attempt.
o Added ConnectionPool::remove(Connection*), which removes a
connection from the pool.
o Added ConnectionPool::exchange(), which wraps remove()
and grab(). It works like a customer support counter in a
store: "I'm sorry, but this Connection is defective. Can I
have another, please?"
o Added a feature to Transaction, where it can send a SET
TRANSACTION ISOLATION LEVEL query before it starts the
transaction proper, affecting the isolation level and the scope
of that change.
o Added ScopedConnection class. Initial version by Joel Fielder,
lots of changes by me. Using it instead of explicit safe_grab()
and release() calls on the pool in examples/cpool.cpp.
o Added FieldNames::operator[](size_type) overloads. This is
necessary to correctly overload the base class versions inherited
from std::vector.
o FieldNames wasn't doing field-by-name matches case insentitively,
most likely since 3.0.0 when we changed it to derive from
std::vector. This caused SSQLS (at least) to be case sensitive.
Fixed this and renamed the stock.sdate field in the SSQLS
examples to stock.sDate to test this.
o Added Query::replace(iter, iter), on the model of existing
insert(iter, iter). Thanks for this patch go to David Walthour.
o Added Query::operator!(), overriding basic_ios version so that
"if (!query)" does the right thing. Fixes problem report in
thread http://lists.mysql.com/plusplus/8594
o Query copy ctor and assignment operator now perform deeper
copies, so you can pass Query objects around in certain ways
that used to cause crashes. Thanks for this patch go to Steven
Van Ingelgem.
o Defined *_null variants for every sql_* typedef, wrapping
all those earlier types in Null<>. All example programs now use
these types instead of explicit Null<>-wrapped types.
o Created a C++ command line parsing mechanism for the examples
today, and for programs coming in the future. It uses the
platform version of getopt() if available, substituting a
public-domain implementation that gets built into MySQL++
itself otherwise. It's documented in the refman -- see
the CommandLineBase class -- but it's in the newly created
mysqlpp::internal namespace, which means we don't promise any
sort of ABI or API stability for it. You're welcome to use it
in your own programs, but expect it to change without warning.
o Added a few missing MYSQLPP_EXPORTs to operator<<()s for stream
manipulators, to allow their use when MySQL++ is built as a DLL.
o Added backticks around table and column identifiers in all
code paths exercised by dtest. There are some others remaining,
particularly things like Row::field_list(). Thanks for this
patch go to Adrian Cornish.
o Added mysqlpp::NOW() which returns a value that, when inserted
into a SQL query, results in a call to SQL's NOW() function.
DateTime::now() -- added in 3.0.0 -- does the same thing,
but this is shorter and matches the SQL syntax.
o Calling DBDriver::disconnect() twice no longer calls
mysql_close() twice.
o Worked around a weakness on Windows that caused problems in code
with a connect(), disconnect(), connect() call pattern, when
also using a named pipe to connect to the DB. (There never
has been a problem with this on other platforms or with other
IPC mechanisms.)
o Initializing a SQLTypeAdapter with a floating-point value
equal to infinity or NaN results in SQL null if the type
is also nullable, or 0 otherwise. Previously, we got an
implementation-defined string, which could give invalid SQL,
or could give 0, a different value from NaN, infinity, or
SQL null. This does collapse the notions of NaN and infinity,
but the MySQL reference manual doesn't say how you're supposed
to preserve these differences.
o Removed the dependency of stadapter.h on sql_types.h, just to get
sql_tinyint*. #including tinyint.h instead, and using equivalent
types to what sql_types.h defines. This is necessary because
sql_types.h should be one of the last things included from
mysql++.h, so that it can define sql_* equivalents for everything
else in MySQL++, which means all those other things need to be
#included by that point.
o The "find MySQL++" autoconf macro (config/mysql++.m4) now
searches for the library in lib64 subdirectories everywhere it
also looks in lib. We did this for the C API finder macro way
back in MySQL++ 2.2.0, and only neglected to do it for this
macro because it's not used by MySQL++ itself, just provided
as a courtesy to MySQL++ users that also use autoconf.
o Also improved the "find C API" macro (config/mysql_loc.m4)
so it, too, is more useful in third-party projects.
o Moved private FieldNames::str_to_lwr() method out into its
own module, in the new mysqlpp::internal namespace, so other
modules can use it. Also added an overload for this new global
method taking std::string instead of char*.
o userman build process can now find FOP when installed from
the standard Ubuntu/Debian package repository.
o No longer generating refman.pdf. It's difficult to generate
properly on some platforms, and isn't all that useful anyway
compared to the HTML version, which builds properly everywhere.
o Dropped custom.h backwards-compatibility header. (Deprecated
over a year ago in MySQL++ 3.0.0.)
o Fixed a bad pointer access crash in Connection::set_option()
triggered when the option set call fails. Thanks for this
patch go to Kevin Regan.
o ReconnectOption behavior now knows about a fix in MySQL 5.1.6 and
newer that lets you set it either before the connection is up,
or after. If you try to set this option when MySQL++ is built
against earlier versions of the MySQL C API, it will refuse to
set the option because it knows the option will be reset when
the connection comes up.
o No longer trying to make the C API library read from a "my"
options file before connect. It does that by default, and
the file is supposed to be .my.cnf anyway.
o Reworked the load_jpeg example code for clarity, extracting
load_jpeg_file() routine as an implementation detail and
making that use the C++ stringstream "slurp into string" idiom
instead of allocating a C char buffer and copying that into
a std::string.
o Restored support for repeating query parameters. Apparently
you could say things like "stuff %0 morestuff %0" in v2.1,
but this was broken by initial 1-parameter fixes in v2.2.
This patch reportedly lets us have both things at once, and
improves handling of 1-parameter template queries in general.
Thanks for this patch go to Martin Gallwey.
o Added examples/tquery4.cpp based on test code and feedback
from Martin.
o Put Comparable class in namespace mysqlpp, where it should always
have been. Aside from being just plain wrong, it caused a
conflict with Boost if you used its Comparable class and hoist
them both into the global namespace. Thanks for this patch go
to Michael Radzewitz.
o Fixed all the known problems with the Xcode project files.
o Skeletal support for SSQLS v2. Doesn't do anything useful
yet, it just got caught up in the need to release 3.1 as-is.
o Various enhancements to the test suite.
o Many, many documentation enhancements.
3.0.9, 2009.02.04 (r2442)
o It is now possible to use Null<T> objects in const context.
o Query was emitting thousands separators when used in some
locales. Thanks for the fix go to Tomaž Šolc.
o Restored support for using Query::storein() with template
queries. Was mistakenly removed in the 3.0.0 development
process.
o GCC 4.4 build fixes. Thanks for this go to Remi Collet.
3.0.8, 2008.11.27 (r2432) The "Thanksgiving" release
o Fixed a VC++ build error introduced in 3.0.7 in the Sun CC fix.
o Fixed the Makefile we generate from Makefile.simple for the
devel RPM. The recent Bakefile upgrade changed the output so
our munger stopped munging.
o Changed all instances of "CREDITS" in header comments to
"CREDITS.txt".
o Brought ebuild file up to date with what Gentoo has been
using for 2.3.2.
3.0.7, 2008.11.21 (r2423)
o Fixed bug where initting a Query with a query string and then
appending more to it with operator <<() would start overwriting
the beginning of the buffer. Thanks for the fix go to Chris
Frey.
o Added String::empty(), to parallel std::string better.
o Added SQLTypeAdapter ctor for Null<String>, to allow SSQLS with
NULL BLOB columns. Thanks for this patch go to Russell Robinson.
o Passing on "throw exceptions" flag in Query::storein() to the
temporary Row objects it creates. (Should have done this
all along.)
o All MySQL++ classes with operator[]() and at() methods now
throw the new BadIndex exception on out of range indices now,
unconditionally. Before, it was a mishmash of MySQL++-specific
mechanisms, std::range_error, and unchecked access.
o Fixed some bugs in load_jpeg and cgi_jpeg examples that prevented
them from working correctly on Windows.
o Squished some warnings and incompatibilities that caused
difficulty with Solaris CC.
o Several minor fixes to allow building on Cygwin again.
o Dedicated VC++ 2008 support. (Not just a clone of VC++ 2005
project files in a different directory.)
o Lots of documentation improvements.
3.0.6, 2008.08.16 (r2350)
o Several fixes to allow thread-aware build on Solaris
o More improvements to search for Fink version of C API library.
o Various improvements to Windows installer (install.hta)
3.0.5, 2008.08.06 (r2332)
o Replaced install.bat with new install.hta, which has a GUI and a
lot of embeded logic for doing The Right Thing, which we couldn't
do in a dumb batch file.
o Several fixes to allow it to build on Solaris 10.
o Fixed a bug in comparison of Null<T> to T: wouldn't always give
the right result for one particular combination of argument
values and order of parameters to operator <(). It wouldn't
fail all the time, either; it depended on the way the system's
memory allocator dealt with newly allocated RAM. The bug was
discovered during the Solaris 10 porting effort, but it is not
a Solaris-specific bug.
o Split Linux-specific material out of README-Unix.txt into
README-Linux.txt, and created README-Solaris.txt.
o Shipping a vc2008 directory. Populated by bootstrap script with
copies of vc2005 files when those are newer, with the idea being
to update them by hand by running them through VC++2008 before
release.
o Several fixes to VS-only examples. They hadn't been updated to
track several of the changes in MySQL++ v3, so they wouldn't
build OOTB at all, crashed when you did get them building, and
emitted a lot of warnings during the build. Cleaned it all up.
o Autoconf now explicitly checks whether we need to link to zlib
to link to MySQL C API library. It used to be required, but
lately, MySQL has been shipping the library with zlib stuff
embedded, causing multiply defined symbol errors on some systems.
o configure script now looks in more locations for the MySQL C API
library, adding default locations for Fink and Solaris.
3.0.4, 2008.07.02 (r2303)
o Fixed a few bugs in SslOption that prevented it from actually
working. If you've been having SSL problems since upgrading
to MySQL++ v3, this is why! Thanks for these patches go to
Petteri Kiiskinen.
o Changed type of String's internal "size" typedefs so it'll
build without errors on 64-bit systems where these ints are
different sizes.
o Many user manual improvements.
3.0.3, 2008.05.11 (r2284)
o Fixed query well-formedness handling in Query::store() and use().
It was quietly eating these errors, confusing them with the
no-results case.
o Fixed examples/cpool.cpp to build without thread support.
o No longer hiding all stdint.h typedefs inside namespace mysqlpp.
o Fixed mysqlpp::String comparisons of empty strings against
nonempty strings; if the empty string was on the left hand side,
it would succeed because it was only comparing against characters
in the empty side, which matches everything. (Fixes bug 11588.)
3.0.2, 2008.04.13 (r2275)
o Increased float to string conversion precision from 7 to 9 and
double from 16 to 17 digits. Previous values weren't enough
near the maximum values that each can hold.
o Replaced Query's safe bool mechanism with an override of
basic_ios::operator void*() to avoid a conflict between the
two mechanisms. As the base class version isn't virtual,
this is arguably evil, but it should be harmless in typical use.
Besides, testing Query in bool context usually isn't the right
thing anyway: test the result set instead.
o Made ConnectionPool::grab() virtual.
o Overriding ConnectionPool::grab() and release() in
examples/cpool.cpp to show how to do connection-in-use count
limiting. Also, added a few more output indicator states to
allow one to better understand program flow.
3.0.1, 2008.03.23 (r2263)
o String objects can now be compared to mysqlpp::null directly.
o Added a template operator== and operator!= to String, syntactic
sugar for the existing String::compare() methods.
o String::compare() now returns 0 ("equal") when one of the
strings is an uninitialized String() (no refcounted buffer)
and the other is empty. It used to consider any initialized
string greater than an uninitted one. An uninitialized String
appears empty, though, so this was incorrect.
o Made Connection::thread_aware(), thread_start() and thread_end()
static methods, so they can be called before you create your
first connection. Ditto for DBDriver versions of these methods.
o Calling Connection::thread_start() and thread_end() in
examples/cpool.cpp, as appropriate. Above changes were necessary
to make this work sensibly.
o Made ConnectionPool::release() virtual, so your pool subclass can
override it.
o Added ConnectionPool::size(), so a subclass can know the current
number of extant connections.
o No longer single-quoting NOW() call generated for default
init of DateTime type when building queries from SSQLS objects
in Query::insert(), replace() and update(). The template query
and stream interfaces of Query treated NOW() correctly already.
o Fixed a bug that left SSQLS::table_override_ uninitted if
you used certain of the generated ctors or set() member
functions instead of others used by the examples. This could
cause a crash any time you caused SSQLS.table() to be called,
such as when passing the SSQLS to Query::insert().
o Minor memset bug fixed in test/uds.cpp. Patch by Dave Jones.
3.0.0, 2008.02.29 (r2236) The "Giant Leap Forward" release
THIS IS NOT A DROP-IN REPLACEMENT FOR MySQL++ v2.x!
You will have to recompile your program against this version
of the library, and you will almost certainly have to make code
changes as well. Please see these sections in the user manual
for information on migrating your code to this new version:
http://tangentsoft.net/mysql++/doc/html/userman/breakages.html#api-3.0.0
http://tangentsoft.net/mysql++/doc/html/userman/breakages.html#abi-3.0.0
o Added ConnectionPool class, primarily to let multithreaded
programs share a set of Connection objects safely in situations
where it isn't acceptable to have a Connection per thread.
o Created examples/cpool.cpp to demonstrate this new class.
o Added RefCountedPointer template, which provides automatic
memory management and data sharing. It's not intended
for use outside of MySQL++ itself, but it's the mechanism
behind everything below where reference counting is mentioned.
I created the initial version of it, but Jonathan Wakely almost
completely rebuilt it, and Joseph Artsimovich provided helpful
commentary and advice as well.
o Many improvements to Specialized SQL Structures (SSQLS):
- Renamed custom* to ssqls*. There's still a custom.h which
#includes ssqls.h for you, but it's only intended to ease
the transition to the new name. It will go away in a future
release, probably as soon as v3.1.
- SSQLSes are finally compatible with Null<>-wrapped types. This
feature is based loosely on the "Waba" patch posted to the
mailing list back in the v2.0 days, but extended to allow
Null<T> types for key fields. (The Waba patch only allowed
these types in non-key fields.)
- It's no longer necessary to define a different SSQLS for each
different field set you use in queries. That is to say,
you can define an SSQLS for an entire table and store just a
subset of the table in it now, with the other fields keeping
default values. Removed examples/custom6.cpp, as custom1.cpp
can now demonstrate the same thing, implicitly.
- An SSQLS's field order no longer has to match the order of
fields in the result set it is populated from.
- As a result of previous, removed sql_create_c_order_* macros;
they have no purpose now.
- Removed order parameters from sql_create_complete_*, which now
gives it the same functionality as sql_create_c_names_* so
removed the latter, too.
- Removed "basic" variants of SSQLS creation macros. They've
been unofficially deprecated by dint of being all but
undocumented and unexemplified for a very long time now.
- It's now possible to use mysqlpp::String, Date, DateTime, and
Time types in the key field positions in an SSQLS as they
now support the necessary comparison interfaces.
- If you use a floating-point data type in one of the key field
positions, it no longer uses exact comparison logic. Instead,
it now does [in]equality comparisons by testing whether the
difference between two floating-point values is less than a
configurable threshold defaulting to 0.00001.
- You can now use 'bool' type in an SSQLS.
- Renamed _table static member variable in each SSQLS to table_
and made it private. There are now public setter and getter
methods, table().
- Added per-instance table name overriding via instance_table()
setter. table() getter returns static version if this is not
set, so it's still a global setting by default.
o You can now use mysqlpp::null as a template query parameter to
get a SQL null.
o Replaced template ColData_Tmpl<T>:
- Used to have typedef ColData_Tmpl<std::string> MutableColData.
It was used only once within MySQL++ itself, and was never
documented as a class for end users. This one use within
the library was a crock, so we just replaced this use with
std::string and removed the typedef.
- This left just one use of ColData_Tmpl<T>, instantiating it
with the MySQL++ utility class const_string, basically a
clone of std::string with all the mutating features removed.
Folded the functionality of const_string into the template,
renamed the result to String, and deleted the const_string
class. It'd be a complete std::string replacement -- with
SQL-related enhancements -- if it were modifiable, but MySQL++
doesn't need it to be modifiable. Yet, it's still the closest
thing MySQL++ has to its own string type; thus the name.
- Replaced its internal buffer management with a much more
clever reference counted scheme. This shows its greatest
advantage in the return from Row::operator[](), which for
technical reasons must return by value, not by reference
as is more common. This lets you pass around Strings by
value while having the efficiency of reference semantics.
This can be important with large return values, like BLOBs.
- Converting String to numeric types (ints, floats...) uses a
new, cleaner system by Jonathan Wakely. Unless you were
abusing weaknesses in the old system, you won't see a
difference. It's just more robust and flexible.
o Redesigned SQLString:
- It used to derive from std::string, and while MySQL++'s
internals did use it in place of std::string, these places
didn't take advantage of the additional features offered
by SQLString. So, replaced all those uses with std::string.
- All the remaining uses are MySQL++ public interfaces that
need to be able to accept any of many different data types,
and we want that data to be automatically converted to a
SQL-compatible string form. Because it no longer has the
parentage to be a general-purpose string type and MySQL++ has
a new contender for that role (String), renamed SQLString to
SQLTypeAdapter to reflect its new, limited purpose. ("STA"
for short.)
- Since we don't have the std::string base class to manage the
string buffer any more, using the same reference counted
buffer mechanism as String. In addition to saving code by
not creating yet another buffer management mechanism, it means
objects of the two classes can share a buffer when you assign
one to the other or pass one to the other's copy ctor.
- Added many more conversion ctors.
- STA interfaces using the 'char' data type now treat them as
single-character strings instead of one-byte integers, as
does the Standard C++ Library.
- Added mysqlpp::tiny_int interfaces to STA to replace the
former char interfaces for those needing one-byte integers.
o As a result of the ColData -> String redesign, removed
Row::raw_*(). Before String copies were efficient, this
was helpful in accessing BLOB data efficiently. It was also
required back when ColData didn't deal correctly with embedded
null characters, but that reason is gone now, too.
o Row::operator[](const char*) no longer unconditionally throws the
BadFieldName exception when you ask for a field that doesn't
exist. It will still throw it if exceptions are enabled, but if
not, it'll just return an empty String. This was necessary to
make the SSQLS subset and field order independence features work.
o Similarly, Result::field_num() returns -1 when exceptions are
disabled and you ask for a field that doesn't exist.
o You can now use the OptionalExceptions mechanism to disable
exceptions on const MySQL++ objects.
o Redesigned query result classes:
- Instead of Result deriving from ResUse, the two derive from
a common base class -- ResultBase -- containing the bits that
are truly the same between them. Before, Result inherited
several methods that didn't really make sense for "store"
query result sets.
- Renamed Result to StoreQueryResult and ResUse to UseQueryResult
so it's clearer what each is for.
- Renamed ResNSel to SimpleResult.
- Made all SimpleResult data members private and hid them behind
const accessor functions of the same name.
- The result set classes all used to be friends of Connection
for various lame reasons. Since they are created by Query,
and Query has a good reason for a strong relationship with
Connection, moved Connection access out of each result set
class into the code in Query that creates that type of result
set object.
- StoreQueryResult now derives from vector<Row> in addition to
ResultBase; it used to merely emulate a vector of Rows, poorly.
It can now dispose of the MYSQL_RESULT at the end of object
construction, because it creates all the Row objects up front
instead of on the fly. And as a result of *that*, operator[]
returns by reference instead of by value, operator -> works
correctly on iterators, all STL algorithms work, etc., etc.
- IMPORTANT COMPATIBILITY BREAK: because we used fetch_row()
stuff in Result previously, it was okay to index past the
end of the result set: you'd just get a falsy Row when you
did this, just as happens when doing the same thing in a
"use" query. The simple1 and simple2 examples did this,
so it's likely that code exists that takes advantage of this
misfeature. New versions of these examples show how to index
through a StoreQueryResult without running past its end.
- ResUse used to delay creation of its FieldNames and FieldTypes
objects until the point of need. This had several implications
for thread and exception safety that we fix by just creating
them in the ctor. If your code is multi-threaded and was
avoiding certain usage patterns due to crashes, it's worth
trying your preferred way again.
- Result sets create a few data structures to hold information
common to all rows in that set. The row objects need access
to these shared data structures, so on creation each gets
a pointer back to the result set object that creates it.
This was efficient, but required that a result set object
outlive any row objects it creates. Now these shared data
structures are reference-counted, decoupling the lifetime of
the child row objects from their result set parent.
- Copy operations for result sets used to actually be "moves"
before, for efficiency. (MySQL++ itelf only copied result
sets in returning them by value from the query execution
methods of Query, so this was acceptable if you didn't do
anything uncommon with these objects.) Reference counted
data structures allow us to have copy semantics now without
sacrificing efficiency.
- You can now use Query::storein() with an STL container of Row
objects now, instead of having to use SSQLSes. The lifetime
issue guaranteed a crash if you tried this before.
- Removed a bunch of unnecessary alias methods:
- columns() -> num_fields()
- names() -> field_names()
- rows() -> num_rows()
- types() -> field_types()
- Renamed several methods for grammar reasons:
- fields(unsigned int) -> field(unsigned int)
- names(const std::string&) -> field_num(const std::string&)
- names(int) -> field_name(int)
- types(int) -> field_type(int)
- Removed several "smelly" methods:
- purge()
- raw_result()
- reset_names()
- reset_field_names()
- reset_types()
- reset_field_types()
o Field class used to just be a typedef for the corresponding C
API class. Now it's a real C++ class providing a more MySQL++
sort of interface, plus good OO things like information hiding
and implementation detail abstraction. This changes several
things about the interface.
o Fields class was basically a specialized std::vector work-alike
for dealing with the C API to get access to MYSQL_FIELD objects
and present them as contained Field objects. New Field type
let us replace it with "typedef std::vector<Field> Fields"
o Major improvements to the quoting and escaping mechanisms:
- Replaced almost all of the type-specific interfaces in manip.h
with a single version taking STA. The compiler can convert
almost anything to STA without losing any information we need
for correct quoting and escaping. This has the side benefit
that we can now do correct quoting and escaping for more data
types now, including plain C and C++ string types.
- Fixed a bug in quote_double_only manipulator for String: was
using single quotes by mistake.
- Escaping and quoting only works in instances where MySQL++
can tell you're building a SQL query and are using a data type
that requires it. This affects many things, but the one most
likely to cause trouble is that inserting MySQL++'s quoting
and escaping manipulators in non-Query ostreams is now a no-op.
- Added escape_string() member functions to Query and
SQLQueryParms::escape_string(), and removed the global function
of the same name. Because these are tied indirectly to a
Connection object, this also has the effect that escaping is
now aware of the current default character set used by the
database server. There's only one case where this isn't done
now, and that's when we're disconnected from the server.
- Previous two items form a trade-off: if your code was depending
on MySQL++ to get SQL escaping and it no longer happens for
what we consider a good reason, you can build a replacement
mechanism using these new functions. Quoting needs no special
support in MySQL++.
- Removed 'r' and 'R' template query parameter modifiers,
which meant "always quote" and "always quote and escape"
regardless of the data type of the parameter. There are no
corresponding manipulators (for good reason), so the removal
restores symmetry.
o Created DBDriver class from code previously in Connection and
Query to almost completely wrap the low-level MySQL C API:
- Connection creates a DBDriver object upon connection and
passes a pointer to it down to Query objects it creates.
In turn, they pass the pointer on to any of their children
that need access to the C API.
- Nothing outside DBDriver calls the C API directly now, though
DBDriver leaks C API data structures quite a lot, so this
feature doesn't constitute "database independence." See the
Wishlist for what must be done to get to that point.
o Completely redesigned the connection option setting mechanism:
- There's now just a single Connection::set_option() method that
takes a pointer to the abstract Option base class, and there is
an Option subclass for every connection option we understand.
Thus, type errors are now caught at compile time instead of
at run time.
- Replaced Connection::enable_ssl() with SslOption class.
- Enabling data compression and setting the connection timeout
are no longer set via parameters to Connection interfaces.
These are now set with CompressOption and ConnectTimeoutOption.
- Similarly, removed client_flag parameters from Connection's
ctor and connect() method and added corresponding Option
subclasses. There's about a dozen, so rather than list them
here, look for similarly-named classes in lib/options.h.
o Added Connection::count_rows() to execute "SELECT COUNT(*) FROM
tablename" queries for you.
o Moved Connection::affected_rows(), info() and insert_id() methods
to class Query, as they relate to the most recently-executed
query, not to the connection.
o Several method name changes in Connection:
- client_info() -> client_version()
- host_info() -> ipc_info()
- proto_info() -> protocol_version()
- server_info() -> server_version()
- stat() -> status()
o Removed Connection::api_version(). It does the same thing as
client_version().
o Lots of changes to Date, DateTime, and Time classes:
- If you use the default constructor for DateTime and don't
subsequently set its year, month, day, hour, minute or second
data members to nonzero values, it becomes the SQL function
"NOW()" in a query string. You can also use DateTime::now()
as syntactic sugar for this.
- As a result of above, had to hide all of DateTime's data
members behind accessor functions, to keep the state of the
object consistent. (If it's initialized as "now" and you
give it an explicit year value, say, it is no longer "now",
so the setter has to clear the now-flag.) There are getters
and setters for year, month, day, hour, minute and second,
all named after the member.
- Did the same for Date and Time for consistency, even though it
isn't technically required.
- The sql_timestamp typedef now aliases DateTime instead of Time.
- Renamed template class DTbase<T> to Comparable<T>. The fact
that it's the common base class of all date and time classes
is irrelevant; making subclasses comparable is what it does,
so that's what it should be named after.
- Added a DateTime ctor taking discrete year, month, day, hour,
minute, and second values.
- Implicit conversion from stringish types to the date and time
types is no longer allowed. This is part of the "Waba"
Null<T> patch mentioned above; allowing implicit conversions
would break this new feature.
- Added operator std::string and str() methods to all of these
classes. Adding this to the existing operator << support, you
now have several ways to convert these objects to string form.
- Added time_t conversion to Date and Time classes. DateTime
already had it, since it's more legitimate to convert time_t
to DateTime, but you could already "slice" it with something
like Time(DateTime(time(0))) so there's no point pretending
you can't get from time_t to Date or Time. Might as well
legitimize it.
o Improved tiny_int class:
- Turned it into a template parameterized on the value type so
you can get both signed and unsigned TINYINTs
- Changed the sql_tinyint and sql_tinyint_unsigned typedefs to
use mysqlpp::tiny_int<VT> instead of raw chars
- Added a bool conversion ctor and operator, and typedef'd it
to sql_bool and sql_boolean to match MySQL server behavior
o Added many more sql_* typedefs. We now have a typedef for every
type the MySQL server knows about, including those it supports
just for compatibility with other database servers.
o Changed the sql_*int* typedefs to use integer types of the same
size as the MySQL server. (Run test/inttypes.cpp to test it.)
o Added copy ctor and assignment operator to Row.
o Row::operator[]() takes int now instead of unsigned int.
This finally (!) makes it possible to say row[0] without the
compiler giving an ambiguous overload error.
o Changed all uses of row.at(0) in the examples to row[0]
o Added operator[] to all classes that only had at().
o Query now automatically resets itself unless the query fails
or you're using template queries. In either case, the contents
of the query's internal buffers are considered precious,
either for debugging, or future queries. Except when using
template queries, this means you may be able to avoid calling
Query::reset() entirely. It's still safe to call reset()
as before, just unnecessary most of the time.
o Removed reset_query parameter from all Query methods. It was
almost completely broken before, and above change does what
was really wanted to begin with.