Description:
Compiling from internal 5.1 bk tree fails when using Visual C++ 2005 Edition due to casts in DDUG_DUMP() calls in sql\log_event.cc:
.\log_event.cc(6400) : error C2664: '_db_dump_' : cannot convert parameter 3 from 'byte *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\log_event.cc(7117) : error C2664: '_db_dump_' : cannot convert parameter 3 from 'byte *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\log_event.cc(7359) : error C2664: '_db_dump_' : cannot convert parameter 3 from 'byte *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\log_event.cc(7503) : error C2664: '_db_dump_' : cannot convert parameter 3 from 'byte *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\log_event.cc(7504) : error C2664: '_db_dump_' : cannot convert parameter 3 from 'byte *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
How to repeat:
* Get latest bk from 5.1.
* Run CMake for VS8.
* Try to compile mysqld project.
Suggested fix:
I added explicit casts at the lines indicated in the error message, which allowed compilation. Not sure if that is the correct solution or not.
===== sql/log_event.cc 1.273 vs edited =====
6400c6400
< DBUG_DUMP("rows", m_rows_buf, data_size);
---
> DBUG_DUMP("rows", (const char *) m_rows_buf, data_size);
7117c7117
< DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
---
> DBUG_DUMP("record[0]", (const char *) table->record[0], table->s->reclength);
7359c7359
< DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
---
> DBUG_DUMP("record[0]", (const char *) table->record[0], table->s->reclength);
7503,7504c7503,7504
< DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
< DBUG_DUMP("record[1]", table->record[1], table->s->reclength);
---
> DBUG_DUMP("record[0]", (const char *) table->record[0], table->s->reclength);
> DBUG_DUMP("record[1]", (const char *) table->record[1], table->s->reclength);