@@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
27
27
#include < string.h>
28
28
#include < stdlib.h>
29
29
#include < memory>
30
+ #include < sstream>
30
31
31
32
#include < cppconn/datatype.h>
32
33
#include < cppconn/exception.h>
@@ -376,7 +377,9 @@ mysql_type_to_datatype(const MYSQL_FIELD * const field)
376
377
const sql::mysql::util::OUR_CHARSET * const cs =
377
378
sql::mysql::util::find_charset (field->charsetnr );
378
379
if (!cs) {
379
- throw SQLException (" Server sent uknown charsetnr. Please report" );
380
+ std::ostringstream msg (" Server sent unknown charsetnr (" );
381
+ msg << field->charsetnr << " ) . Please report" ;
382
+ throw SQLException (msg.str ());
380
383
}
381
384
return isBinary ? sql::DataType::VARBINARY : sql::DataType::VARCHAR;
382
385
}
@@ -389,7 +392,9 @@ mysql_type_to_datatype(const MYSQL_FIELD * const field)
389
392
const sql::mysql::util::OUR_CHARSET * const cs =
390
393
sql::mysql::util::find_charset (field->charsetnr );
391
394
if (!cs) {
392
- throw SQLException (" Server sent uknown charsetnr. Please report" );
395
+ std::ostringstream msg (" Server sent unknown charsetnr (" );
396
+ msg << field->charsetnr << " ) . Please report" ;
397
+ throw SQLException (msg.str ());
393
398
}
394
399
return isBinary ? sql::DataType::LONGVARBINARY : sql::DataType::LONGVARCHAR;
395
400
}
@@ -541,7 +546,9 @@ mysql_type_to_string(const MYSQL_FIELD * const field, boost::shared_ptr< sql::my
541
546
if (!isBinary) {
542
547
const sql::mysql::util::OUR_CHARSET * cset = find_charset (field->charsetnr );
543
548
if (!cset) {
544
- throw SQLException (" Server sent uknown charsetnr. Please report" );
549
+ std::ostringstream msg (" Server sent unknown charsetnr (" );
550
+ msg << field->charsetnr << " ) . Please report" ;
551
+ throw SQLException (msg.str ());
545
552
}
546
553
char_maxlen = cset->char_maxlen ;
547
554
}
@@ -556,7 +563,9 @@ mysql_type_to_string(const MYSQL_FIELD * const field, boost::shared_ptr< sql::my
556
563
if (!isBinary) {
557
564
const sql::mysql::util::OUR_CHARSET * cset = find_charset (field->charsetnr );
558
565
if (!cset) {
559
- throw SQLException (" Server sent uknown charsetnr. Please report" );
566
+ std::ostringstream msg (" Server sent unknown charsetnr (" );
567
+ msg << field->charsetnr << " ) . Please report" ;
568
+ throw SQLException (msg.str ());
560
569
}
561
570
char_maxlen = cset->char_maxlen ;
562
571
}
@@ -571,7 +580,9 @@ mysql_type_to_string(const MYSQL_FIELD * const field, boost::shared_ptr< sql::my
571
580
if (!isBinary) {
572
581
const sql::mysql::util::OUR_CHARSET * cset = find_charset (field->charsetnr );
573
582
if (!cset) {
574
- throw SQLException (" Server sent uknown charsetnr. Please report" );
583
+ std::ostringstream msg (" Server sent unknown charsetnr (" );
584
+ msg << field->charsetnr << " ) . Please report" ;
585
+ throw SQLException (msg.str ());
575
586
}
576
587
char_maxlen = cset->char_maxlen ;
577
588
}
@@ -586,7 +597,9 @@ mysql_type_to_string(const MYSQL_FIELD * const field, boost::shared_ptr< sql::my
586
597
if (!isBinary) {
587
598
const sql::mysql::util::OUR_CHARSET * cset = find_charset (field->charsetnr );
588
599
if (!cset) {
589
- throw SQLException (" Server sent uknown charsetnr. Please report" );
600
+ std::ostringstream msg (" Server sent unknown charsetnr (" );
601
+ msg << field->charsetnr << " ) . Please report" ;
602
+ throw SQLException (msg.str ());
590
603
}
591
604
char_maxlen = cset->char_maxlen ;
592
605
}
0 commit comments