Skip to content

Commit

Permalink
Handle document type fields in mysql_checksum_table
Browse files Browse the repository at this point in the history
Summary: see title

Test Plan: mtr

Reviewers: tianx, pengt

Reviewed By: pengt
  • Loading branch information
santoshbanda authored and jtolmer committed Jan 5, 2016
1 parent 0e3dfa8 commit d6c1603
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mysql-test/suite/json/r/type_document_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,11 @@ SET @@global.allow_document_type = @start_allow_document_type;
SELECT @@global.allow_document_type;
@@global.allow_document_type
1
checksum table t_big;
Table Checksum
test.t_big 3679544945
checksum table t_big;
Table Checksum
test.t_big 3679544945
drop table t, t1, t2, t3, t_big, t_big2;
include/rpl_end.inc
6 changes: 6 additions & 0 deletions mysql-test/suite/json/t/type_document_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ alter table t3 modify column s document;
SET @@global.allow_document_type = @start_allow_document_type;
SELECT @@global.allow_document_type;

checksum table t_big;
connection slave;
# Should be same as that on master
checksum table t_big;

connection master;
drop table t, t1, t2, t3, t_big, t_big2;

--source include/rpl_end.inc
3 changes: 2 additions & 1 deletion sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9697,14 +9697,15 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables,

/*
BLOB and VARCHAR have pointers in their field, we must convert
to string; GEOMETRY is implemented on top of BLOB.
to string; GEOMETRY and DOCUMENT are implemented on top of BLOB.
BIT may store its data among NULL bits, convert as well.
*/
switch (f->type()) {
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_VARCHAR:
case MYSQL_TYPE_GEOMETRY:
case MYSQL_TYPE_BIT:
case MYSQL_TYPE_DOCUMENT:
{
String tmp;
f->val_str(&tmp);
Expand Down

0 comments on commit d6c1603

Please sign in to comment.