Merge lp:~y-trudeau/percona-data-recovery-tool-for-innodb/With_binary_support into lp:percona-data-recovery-tool-for-innodb

Proposed by Yves Trudeau
Status: Merged
Merged at revision: 38
Proposed branch: lp:~y-trudeau/percona-data-recovery-tool-for-innodb/With_binary_support
Merge into: lp:percona-data-recovery-tool-for-innodb
Diff against target: 68 lines (+15/-3)
4 files modified
constraints_parser.c (+2/-2)
create_defs.pl (+8/-0)
include/tables_dict.h (+2/-1)
print_data.c (+3/-0)
To merge this branch: bzr merge lp:~y-trudeau/percona-data-recovery-tool-for-innodb/With_binary_support
Reviewer Review Type Date Requested Status
Aleksandr Kuzminsky (community) Needs Fixing
Review via email: mp+73298@code.launchpad.net

Description of the change

Added support for Binary and varbinary using hex values in the same way has blob was handled.

To post a comment you must log in.
Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

found a bug in varbinary() - investigating

Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

63 + case FT_BIN:
64 + print_hex((char*)value, len);
65 +

After line 64 break; is needed

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'constraints_parser.c'
2--- constraints_parser.c 2011-08-26 14:56:54 +0000
3+++ constraints_parser.c 2011-08-29 21:24:24 +0000
4@@ -703,7 +703,7 @@
5 for(i = 0; i < table->fields_count; i++) {
6 if (table->fields[i].type == FT_INTERNAL) continue;
7 if(comma) fprintf(stderr, ", ");
8- if(table->fields[i].type == FT_BLOB){
9+ if(table->fields[i].type == FT_BLOB || table->fields[i].type == FT_BIN){
10 fprintf(stderr, "@var_%s", table->fields[i].name);
11 has_set = 1;
12 }
13@@ -718,7 +718,7 @@
14 fprintf(stderr, "\nSET\n");
15 for(i = 0; i < table->fields_count; i++) {
16 if (table->fields[i].type == FT_INTERNAL) continue;
17- if(table->fields[i].type == FT_BLOB){
18+ if(table->fields[i].type == FT_BLOB || table->fields[i].type == FT_BIN){
19 if(comma) fprintf(stderr, ",\n");
20 fprintf(stderr, " %s = UNHEX(@var_%s)", table->fields[i].name, table->fields[i].name);
21 comma = 1;
22
23=== modified file 'create_defs.pl'
24--- create_defs.pl 2011-08-28 00:49:50 +0000
25+++ create_defs.pl 2011-08-29 21:24:24 +0000
26@@ -368,6 +368,14 @@
27 return { type => 'FT_CHAR', min_len => 0, max_len => $1 };
28 }
29
30+ if ($type =~ /^BINARY\((\d+)\)/i) {
31+ return { type => 'FT_BIN', fixed_len => $1 };
32+ }
33+
34+ if ($type =~ /VARBINARY\((\d+)\)/i) {
35+ return { type => 'FT_BIN', min_len => 0, max_len => $1 };
36+ }
37+
38 if ($type =~ /^TINYTEXT$/i) {
39 return { type => 'FT_TEXT', min_len => 0, max_len => 255 };
40 }
41
42=== modified file 'include/tables_dict.h'
43--- include/tables_dict.h 2010-09-29 12:05:50 +0000
44+++ include/tables_dict.h 2011-08-29 21:24:24 +0000
45@@ -59,7 +59,8 @@
46 FT_TEXT, // supported (w/o externals)
47 FT_BIT,
48 FT_DECIMAL, // supported
49- FT_TIMESTAMP // supported
50+ FT_TIMESTAMP, // supported
51+ FT_BIN // supported
52 } field_type_t;
53
54 typedef struct field_def {
55
56=== modified file 'print_data.c'
57--- print_data.c 2011-08-28 00:49:50 +0000
58+++ print_data.c 2011-08-29 21:24:24 +0000
59@@ -212,6 +212,9 @@
60 print_string((char*)value, len, field);
61 break;
62
63+ case FT_BIN:
64+ print_hex((char*)value, len);
65+
66 case FT_BLOB:
67 print_hex((char*)value, len);
68 break;

Subscribers

People subscribed via source and target branches