Description:
When using the mysqldbcompare to find differences between two databases in different servers the tool always keep blocked with the same table and after a couple of hours then print the following error:
Traceback (most recent call last):
File "/usr/bin/mysqldbcompare", line 303, in <module>
db1, db2, options)
File "/usr/lib/python2.6/site-packages/mysql/utilities/command/dbcompare.py", line 482, in database_compare
reporter, options)
File "/usr/lib/python2.6/site-packages/mysql/utilities/command/dbcompare.py", line 319, in _check_data_consistency
reporter=reporter)
File "/usr/lib/python2.6/site-packages/mysql/utilities/common/dbcompare.py", line 1313, in check_consistency
tbl1_hash = _make_sum_rows(table1, pri_idx_str1, span_key_size)
File "/usr/lib/python2.6/site-packages/mysql/utilities/common/dbcompare.py", line 941, in _make_sum_rows
_COMPARE_SUM.format(db=table.q_db_name, compare_tbl=q_tbl_name))
File "/usr/lib/python2.6/site-packages/mysql/utilities/common/server.py", line 1164, in exec_query
cur.close()
File "/usr/lib/python2.6/site-packages/mysql/connector/cursor.py", line 339, in close
raise errors.InternalError("Unread result found.")
mysql.connector.errors.InternalError: Unread result found.
How to repeat:
The versions of the tools used are:
MySQL Utilities 1.5.1 rc (mysql-utilities-1.5.1-1.el6.noarch.rpm)
Connector/Python 2.0 alpha (mysql-connector-python-2.0.0-1.el6.noarch.rpm)
The call to the command is:
mysqldbcompare --run-all-tests --changes-for=server1 --difftype=unified --format=grid --disable-binary-logging --server1=/ruta/options.cnf[conf1] --server2=/ruta/options.cnf[conf2] base_datos1:base_datos2
In the "options.cnf" file, both sections (conf1, conf2) are set with the next parameters: user, host(one is 127.0.0.1), password, ssl-ca, ssl-cert, ssl-key. (Both Servers Connect Using SSL Encryption).
Part of the output of the tool is:
... (content omitted for brevity)
# Defn Row Data
# Type Object Name Diff Count Check
# -------------------------------------------------------------------------
# TABLE sec_relation pass pass -
# - Compare table checksum FAIL
# - Find row differences pass
# TABLE sec_relation_level FAIL pass -
# - Compare table checksum FAIL
(the tool doesn't pass this point)
The table that have the problem has the next structure in both servers:
CREATE TABLE sec_relation_level (
relation smallint(5) unsigned NOT NULL,
level smallint(5) unsigned NOT NULL,
PRIMARY KEY (`relation`,`level`) USING BTREE,
KEY fk_sec_relation_level_sec_level (level),
CONSTRAINT fk_sec_relation_level_sec_level FOREIGN KEY (level) REFERENCES sec_level (level) ON UPDATE CASCADE,
CONSTRAINT fk_sec_relation_level_sec_relation FOREIGN KEY (relation) REFERENCES sec_relation (relation) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The referenced tables have the structure:
CREATE TABLE sec_relation (
relation smallint(5) unsigned NOT NULL AUTO_INCREMENT,
description varchar(100) NOT NULL,
PRIMARY KEY (relation)
) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=utf8;
CREATE TABLE sec_level (
level smallint(5) unsigned NOT NULL AUTO_INCREMENT,
description varchar(100) NOT NULL,
level_name varchar(60) NOT NULL,
PRIMARY KEY (level),
UNIQUE KEY uk_relation_name (level_name) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=526 DEFAULT CHARSET=utf8;
The data of the table "sec_relation_level" in both servers is the same and is:
+----------+-------+
| relation | level |
+----------+-------+
| 49 | 1 |
| 50 | 1 |
| 51 | 1 |
| 49 | 2 |
| 51 | 2 |
| 49 | 3 |
| 51 | 3 |
| 49 | 4 |
| 51 | 4 |
| 52 | 4 |
| 49 | 5 |
| 51 | 5 |
| 49 | 6 |
| 51 | 6 |
| 49 | 9 |
| 49 | 12 |
| 51 | 12 |
| 49 | 21 |
| 49 | 22 |
| 49 | 23 |
| 51 | 23 |
| 52 | 23 |
| 49 | 24 |
| 51 | 24 |
| 49 | 25 |
| 50 | 25 |
| 51 | 25 |
| 49 | 26 |
| 51 | 26 |
| 49 | 27 |
| 51 | 27 |
| 49 | 28 |
| 50 | 28 |
| 51 | 28 |
| 49 | 29 |
| 50 | 29 |
| 51 | 29 |
| 49 | 30 |
| 50 | 30 |
| 51 | 30 |
| 49 | 31 |
| 50 | 31 |
| 51 | 31 |
| 49 | 32 |
| 50 | 32 |
| 51 | 32 |
| 49 | 33 |
| 51 | 33 |
| 49 | 34 |
| 51 | 34 |
| 52 | 34 |
| 49 | 35 |
| 51 | 35 |
| 49 | 45 |
| 51 | 45 |
| 49 | 56 |
| 51 | 56 |
| 49 | 67 |
| 51 | 67 |
| 49 | 78 |
| 51 | 78 |
| 49 | 89 |
| 51 | 89 |
| 49 | 96 |
| 49 | 97 |
| 49 | 98 |
| 51 | 98 |
| 49 | 99 |
| 1 | 100 |
| 53 | 100 |
| 100 | 100 |
| 107 | 100 |
| 55 | 101 |
| 118 | 101 |
| 55 | 102 |
| 118 | 102 |
| 54 | 103 |
| 55 | 103 |
| 60 | 103 |
| 118 | 103 |
| 19 | 104 |
| 6 | 105 |
| 54 | 106 |
| 55 | 106 |
| 116 | 106 |
| 118 | 106 |
| 54 | 107 |
| 55 | 107 |
| 60 | 107 |
| 116 | 107 |
| 118 | 107 |
| 55 | 108 |
| 116 | 108 |
| 118 | 108 |
| 55 | 109 |
| 118 | 109 |
| 54 | 110 |
| 55 | 110 |
| 118 | 110 |
| 54 | 111 |
| 55 | 111 |
| 60 | 111 |
| 118 | 111 |
| 55 | 112 |
| 118 | 112 |
| 53 | 113 |
| 57 | 113 |
| 53 | 114 |
| 58 | 114 |
| 47 | 115 |
| 101 | 115 |
| 117 | 115 |
| 3 | 116 |
| 4 | 116 |
| 5 | 116 |
| 6 | 116 |
| 7 | 116 |
| 8 | 116 |
| 9 | 116 |
| 10 | 116 |
| 11 | 116 |
| 12 | 116 |
| 13 | 116 |
| 14 | 116 |
| 15 | 116 |
| 53 | 116 |
| 56 | 116 |
| 68 | 116 |
| 69 | 116 |
| 80 | 116 |
| 90 | 116 |
| 91 | 116 |
| 35 | 117 |
| 36 | 117 |
| 35 | 118 |
| 35 | 119 |
| 36 | 119 |
| 20 | 120 |
| 33 | 121 |
| 48 | 121 |
| 49 | 121 |
| 24 | 122 |
| 31 | 122 |
| 33 | 122 |
| 24 | 123 |
| 31 | 123 |
| 33 | 123 |
| 24 | 126 |
| 33 | 126 |
| 32 | 127 |
| 32 | 128 |
| 32 | 129 |
| 10 | 131 |
| 14 | 131 |
| 30 | 131 |
| 41 | 132 |
| 1 | 133 |
| 53 | 133 |
| 57 | 133 |
| 58 | 133 |
| 59 | 133 |
| 100 | 133 |
| 107 | 133 |
| 1 | 134 |
| 10 | 134 |
| 14 | 134 |
| 53 | 134 |
| 13 | 135 |
| 90 | 135 |
| 12 | 143 |
| 14 | 144 |
| 11 | 145 |
| 10 | 146 |
| 40 | 147 |
| 40 | 148 |
| 40 | 149 |
| 40 | 152 |
| 40 | 153 |
| 2 | 154 |
| 5 | 154 |
| 19 | 154 |
| 69 | 154 |
| 21 | 155 |
| 97 | 155 |
| 21 | 156 |
| 22 | 156 |
| 93 | 156 |
| 21 | 157 |
| 22 | 157 |
| 21 | 158 |
| 22 | 158 |
| 24 | 159 |
| 61 | 159 |
| 53 | 160 |
| 57 | 160 |
| 47 | 161 |
| 101 | 161 |
| 117 | 161 |
| 54 | 162 |
| 55 | 162 |
| 118 | 162 |
| 30 | 163 |
| 4 | 169 |
| 68 | 169 |
| 19 | 170 |
| 7 | 171 |
| 5 | 172 |
| 69 | 172 |
| 10 | 173 |
| 53 | 173 |
| 59 | 173 |
| 47 | 174 |
| 101 | 174 |
| 117 | 174 |
| 62 | 175 |
| 19 | 176 |
| 47 | 177 |
| 101 | 177 |
| 117 | 177 |
| 9 | 178 |
| 3 | 179 |
| 6 | 180 |
| 8 | 181 |
| 53 | 182 |
| 56 | 182 |
| 4 | 183 |
| 68 | 183 |
| 7 | 184 |
| 5 | 185 |
| 69 | 185 |
| 53 | 186 |
| 58 | 186 |
| 47 | 187 |
| 101 | 187 |
| 117 | 187 |
| 53 | 188 |
| 3 | 189 |
| 6 | 190 |
| 8 | 191 |
| 33 | 192 |
| 39 | 192 |
| 29 | 193 |
| 33 | 193 |
| 55 | 195 |
| 118 | 195 |
| 29 | 196 |
| 29 | 198 |
| 33 | 198 |
| 23 | 200 |
| 23 | 201 |
| 54 | 207 |
| 55 | 207 |
| 118 | 207 |
| 35 | 208 |
| 36 | 208 |
| 35 | 209 |
| 36 | 209 |
| 35 | 210 |
| 36 | 210 |
| 35 | 211 |
| 36 | 211 |
| 35 | 212 |
| 36 | 212 |
| 35 | 213 |
| 36 | 213 |
| 35 | 214 |
| 36 | 214 |
| 35 | 215 |
| 36 | 215 |
| 35 | 216 |
| 36 | 216 |
| 35 | 217 |
| 36 | 217 |
| 33 | 218 |
| 34 | 218 |
| 33 | 219 |
| 39 | 219 |
| 38 | 220 |
| 33 | 221 |
| 37 | 221 |
| 33 | 222 |
| 48 | 222 |
| 49 | 222 |
| 16 | 223 |
| 17 | 223 |
| 18 | 223 |
| 18 | 224 |
| 17 | 225 |
| 16 | 226 |
| 44 | 227 |
| 42 | 228 |
| 25 | 229 |
| 27 | 229 |
| 66 | 229 |
| 53 | 230 |
| 53 | 231 |
| 23 | 256 |
| 29 | 257 |
| 33 | 257 |
| 28 | 258 |
| 28 | 259 |
| 26 | 260 |
| 25 | 261 |
| 33 | 261 |
| 53 | 262 |
| 54 | 262 |
| 55 | 262 |
| 56 | 262 |
| 57 | 262 |
| 60 | 262 |
| 62 | 262 |
| 118 | 262 |
| 53 | 263 |
| 35 | 264 |
| 36 | 264 |
| 35 | 265 |
| 36 | 265 |
| 33 | 284 |
| 34 | 284 |
| 1 | 285 |
| 53 | 285 |
| 100 | 285 |
| 107 | 285 |
| 1 | 286 |
| 10 | 286 |
| 14 | 286 |
| 53 | 286 |
| 24 | 287 |
| 31 | 287 |
| 4 | 288 |
| 68 | 288 |
| 19 | 289 |
| 7 | 290 |
| 5 | 291 |
| 69 | 291 |
| 19 | 292 |
| 3 | 293 |
| 6 | 294 |
| 8 | 295 |
| 29 | 296 |
| 33 | 296 |
| 15 | 300 |
| 55 | 301 |
| 118 | 301 |
| 55 | 302 |
| 118 | 302 |
| 55 | 303 |
| 118 | 303 |
| 21 | 304 |
| 22 | 305 |
| 53 | 306 |
| 53 | 307 |
| 54 | 307 |
| 55 | 307 |
| 118 | 307 |
| 11 | 308 |
| 26 | 308 |
| 27 | 308 |
| 31 | 308 |
| 33 | 308 |
| 65 | 308 |
| 54 | 309 |
| 55 | 309 |
| 118 | 309 |
| 54 | 310 |
| 55 | 310 |
| 118 | 310 |
| 55 | 311 |
| 118 | 311 |
| 24 | 312 |
| 54 | 313 |
| 55 | 313 |
| 60 | 313 |
| 118 | 313 |
| 35 | 314 |
| 36 | 314 |
| 11 | 315 |
| 21 | 315 |
| 22 | 315 |
| 23 | 315 |
| 24 | 315 |
| 25 | 315 |
| 26 | 315 |
| 27 | 315 |
| 28 | 315 |
| 29 | 315 |
| 30 | 315 |
| 31 | 315 |
| 32 | 315 |
| 33 | 315 |
| 34 | 315 |
| 35 | 315 |
| 36 | 315 |
| 54 | 315 |
| 55 | 315 |
| 60 | 315 |
| 65 | 315 |
| 66 | 315 |
| 74 | 315 |
| 77 | 315 |
| 79 | 315 |
| 86 | 315 |
| 94 | 315 |
| 98 | 315 |
| 109 | 315 |
| 118 | 315 |
| 45 | 316 |
| 18 | 317 |
| 17 | 318 |
| 16 | 319 |
| 23 | 320 |
| 33 | 321 |
| 34 | 321 |
| 29 | 322 |
| 28 | 323 |
| 28 | 324 |
| 26 | 325 |
| 25 | 326 |
| 25 | 327 |
| 19 | 328 |
| 20 | 328 |
| 73 | 328 |
| 112 | 328 |
| 114 | 328 |
| 28 | 329 |
| 53 | 334 |
| 54 | 334 |
| 60 | 334 |
| 54 | 335 |
| 55 | 335 |
| 60 | 335 |
| 116 | 335 |
| 118 | 335 |
| 1 | 336 |
| 53 | 336 |
| 100 | 336 |
| 107 | 336 |
| 1 | 337 |
| 53 | 337 |
| 100 | 337 |
| 107 | 337 |
| 29 | 338 |
| 33 | 338 |
| 29 | 339 |
| 29 | 340 |
| 33 | 340 |
| 11 | 341 |
| 26 | 341 |
| 31 | 341 |
| 33 | 341 |
| 65 | 341 |
| 25 | 345 |
| 33 | 345 |
| 66 | 345 |
| 33 | 350 |
| 34 | 350 |
| 2 | 351 |
| 24 | 352 |
| 31 | 352 |
| 33 | 352 |
| 24 | 353 |
| 33 | 353 |
| 24 | 354 |
| 33 | 354 |
| 11 | 355 |
| 27 | 355 |
| 31 | 355 |
| 54 | 356 |
| 55 | 356 |
| 116 | 356 |
| 118 | 356 |
| 53 | 357 |
| 59 | 357 |
| 47 | 358 |
| 101 | 358 |
| 117 | 358 |
| 53 | 359 |
| 58 | 359 |
| 47 | 360 |
| 101 | 360 |
| 117 | 360 |
| 53 | 361 |
| 43 | 362 |
| 35 | 363 |
| 36 | 363 |
| 53 | 364 |
| 46 | 365 |
| 4 | 366 |
| 68 | 366 |
| 7 | 367 |
| 5 | 368 |
| 69 | 368 |
| 3 | 369 |
| 6 | 370 |
| 8 | 371 |
| 23 | 372 |
| 33 | 373 |
| 34 | 373 |
| 29 | 374 |
| 33 | 374 |
| 28 | 375 |
| 28 | 376 |
| 26 | 377 |
| 25 | 378 |
| 33 | 378 |
| 65 | 379 |
| 10 | 384 |
| 12 | 384 |
| 18 | 384 |
| 12 | 385 |
| 10 | 386 |
| 12 | 386 |
| 18 | 386 |
| 10 | 387 |
| 13 | 387 |
| 90 | 387 |
| 10 | 388 |
| 14 | 388 |
| 10 | 389 |
| 13 | 389 |
| 10 | 390 |
| 11 | 390 |
| 13 | 390 |
| 10 | 391 |
| 11 | 391 |
| 13 | 391 |
| 10 | 392 |
| 12 | 392 |
| 13 | 392 |
| 10 | 393 |
| 12 | 393 |
| 13 | 393 |
| 10 | 394 |
| 12 | 394 |
| 10 | 395 |
| 12 | 395 |
| 13 | 395 |
| 18 | 395 |
| 13 | 396 |
| 75 | 397 |
| 73 | 398 |
| 114 | 398 |
| 74 | 399 |
| 109 | 399 |
| 77 | 400 |
| 75 | 401 |
| 47 | 402 |
| 73 | 403 |
| 75 | 403 |
| 114 | 403 |
| 76 | 404 |
| 47 | 405 |
| 74 | 406 |
| 109 | 406 |
| 74 | 407 |
| 77 | 408 |
| 73 | 409 |
| 114 | 409 |
| 73 | 410 |
| 79 | 411 |
| 80 | 412 |
| 91 | 412 |
| 81 | 413 |
| 76 | 414 |
| 74 | 415 |
| 82 | 416 |
| 84 | 417 |
| 84 | 418 |
| 84 | 419 |
| 73 | 420 |
| 49 | 421 |
| 49 | 422 |
| 49 | 423 |
| 49 | 424 |
| 49 | 425 |
| 49 | 426 |
| 49 | 427 |
| 49 | 428 |
| 49 | 429 |
| 49 | 430 |
| 49 | 431 |
| 49 | 432 |
| 49 | 433 |
| 49 | 434 |
| 85 | 434 |
| 49 | 435 |
| 85 | 435 |
| 49 | 436 |
| 85 | 436 |
| 49 | 437 |
| 49 | 438 |
| 49 | 439 |
| 49 | 440 |
| 49 | 441 |
| 49 | 442 |
| 49 | 443 |
| 49 | 444 |
| 49 | 445 |
| 49 | 446 |
| 49 | 447 |
| 49 | 448 |
| 49 | 449 |
| 49 | 450 |
| 49 | 451 |
| 49 | 452 |
| 49 | 453 |
| 49 | 454 |
| 49 | 455 |
| 49 | 456 |
| 49 | 457 |
| 49 | 458 |
| 49 | 459 |
| 49 | 460 |
| 49 | 461 |
| 49 | 462 |
| 49 | 463 |
| 49 | 464 |
| 49 | 465 |
| 49 | 466 |
| 49 | 467 |
| 49 | 468 |
| 49 | 469 |
| 49 | 470 |
| 49 | 471 |
| 49 | 472 |
| 49 | 473 |
| 49 | 474 |
| 49 | 475 |
| 49 | 476 |
| 49 | 477 |
| 49 | 478 |
| 49 | 479 |
| 49 | 480 |
| 49 | 481 |
| 49 | 482 |
| 49 | 483 |
| 49 | 484 |
| 49 | 485 |
| 49 | 486 |
| 49 | 487 |
| 73 | 488 |
| 86 | 489 |
| 86 | 490 |
| 94 | 490 |
| 73 | 491 |
| 88 | 492 |
| 101 | 492 |
| 89 | 493 |
| 92 | 493 |
| 91 | 494 |
| 91 | 495 |
| 91 | 496 |
| 91 | 497 |
| 101 | 498 |
| 92 | 499 |
| 101 | 499 |
| 92 | 500 |
| 92 | 501 |
| 92 | 502 |
| 112 | 502 |
| 93 | 503 |
| 93 | 504 |
| 93 | 505 |
| 93 | 506 |
| 94 | 507 |
| 55 | 508 |
| 55 | 509 |
| 55 | 510 |
| 55 | 511 |
| 55 | 512 |
| 55 | 513 |
| 47 | 514 |
| 117 | 514 |
| 98 | 515 |
| 99 | 516 |
| 94 | 517 |
| 98 | 518 |
| 81 | 519 |
| 88 | 520 |
| 89 | 520 |
| 92 | 520 |
| 101 | 520 |
| 112 | 520 |
| 115 | 521 |
| 77 | 522 |
| 77 | 523 |
| 101 | 524 |
| 101 | 525 |
+----------+-------+
688 rows in set (0.00 sec)