Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fb1b8476
Commit
fb1b8476
authored
Oct 01, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug#5349 ALTER TABLE corrupts TEXT (and blob?)
parent
a72c25b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
4 deletions
+46
-4
mysql-test/r/ndb_blob.result
mysql-test/r/ndb_blob.result
+21
-0
mysql-test/t/ndb_blob.test
mysql-test/t/ndb_blob.test
+18
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+6
-3
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-1
No files found.
mysql-test/r/ndb_blob.result
View file @
fb1b8476
...
...
@@ -377,3 +377,24 @@ count(*)
0
drop table t1;
drop database mysqltest;
set autocommit=1;
use test;
CREATE TABLE t1 (
a int,
b text,
PRIMARY KEY (a)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES
(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
alter table t1 engine=ndb;
select * from t1 order by a;
a b
1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
drop table t1;
mysql-test/t/ndb_blob.test
View file @
fb1b8476
...
...
@@ -308,3 +308,21 @@ rollback;
select
count
(
*
)
from
t1
;
drop
table
t1
;
drop
database
mysqltest
;
set
autocommit
=
1
;
use
test
;
CREATE
TABLE
t1
(
a
int
,
b
text
,
PRIMARY
KEY
(
a
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
VALUES
(
1
,
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
);
INSERT
INTO
t1
VALUES
(
2
,
'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'
);
select
*
from
t1
order
by
a
;
alter
table
t1
engine
=
ndb
;
select
*
from
t1
order
by
a
;
drop
table
t1
;
sql/ha_ndbcluster.cc
View file @
fb1b8476
...
...
@@ -389,7 +389,7 @@ int ha_ndbcluster::set_ndb_key(NdbOperation *ndb_op, Field *field,
*/
int
ha_ndbcluster
::
set_ndb_value
(
NdbOperation
*
ndb_op
,
Field
*
field
,
uint
fieldnr
)
uint
fieldnr
,
bool
*
set_blob_value
)
{
const
byte
*
field_ptr
=
field
->
ptr
;
uint32
pack_len
=
field
->
pack_length
();
...
...
@@ -434,6 +434,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
(
unsigned
)
blob_ptr
,
blob_len
));
DBUG_DUMP
(
"value"
,
(
char
*
)
blob_ptr
,
min
(
blob_len
,
26
));
if
(
set_blob_value
)
*
set_blob_value
=
true
;
// No callback needed to write value
DBUG_RETURN
(
ndb_blob
->
setValue
(
blob_ptr
,
blob_len
)
!=
0
);
}
...
...
@@ -1583,11 +1585,12 @@ int ha_ndbcluster::write_row(byte *record)
}
// Set non-key attribute(s)
bool
set_blob_value
=
false
;
for
(
i
=
0
;
i
<
table
->
fields
;
i
++
)
{
Field
*
field
=
table
->
field
[
i
];
if
(
!
(
field
->
flags
&
PRI_KEY_FLAG
)
&&
set_ndb_value
(
op
,
field
,
i
))
set_ndb_value
(
op
,
field
,
i
,
&
set_blob_value
))
{
skip_auto_increment
=
true
;
ERR_RETURN
(
op
->
getNdbError
());
...
...
@@ -1606,7 +1609,7 @@ int ha_ndbcluster::write_row(byte *record)
bulk_insert_not_flushed
=
true
;
if
((
rows_to_insert
==
1
)
||
((
rows_inserted
%
bulk_insert_rows
)
==
0
)
||
uses_blob_value
(
false
)
!=
0
)
set_blob_value
)
{
THD
*
thd
=
current_thd
;
// Send rows to NDB
...
...
sql/ha_ndbcluster.h
View file @
fb1b8476
...
...
@@ -210,7 +210,7 @@ class ha_ndbcluster: public handler
uint
fieldnr
,
const
byte
*
field_ptr
);
int
set_ndb_key
(
NdbOperation
*
,
Field
*
field
,
uint
fieldnr
,
const
byte
*
field_ptr
);
int
set_ndb_value
(
NdbOperation
*
,
Field
*
field
,
uint
fieldnr
);
int
set_ndb_value
(
NdbOperation
*
,
Field
*
field
,
uint
fieldnr
,
bool
*
set_blob_value
=
0
);
int
get_ndb_value
(
NdbOperation
*
,
Field
*
field
,
uint
fieldnr
,
byte
*
);
friend
int
g_get_ndb_blobs_value
(
NdbBlob
*
ndb_blob
,
void
*
arg
);
int
get_ndb_blobs_value
(
NdbBlob
*
last_ndb_blob
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment