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
2585b193
Commit
2585b193
authored
Jul 30, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents
35d7afbe
fdc277c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
11 deletions
+43
-11
mysql-test/r/auto_increment.result
mysql-test/r/auto_increment.result
+18
-0
mysql-test/t/auto_increment.test
mysql-test/t/auto_increment.test
+7
-0
sql/field.h
sql/field.h
+1
-1
sql/sql_base.cc
sql/sql_base.cc
+2
-2
sql/sql_list.h
sql/sql_list.h
+2
-2
sql/sql_table.cc
sql/sql_table.cc
+13
-6
No files found.
mysql-test/r/auto_increment.result
View file @
2585b193
...
...
@@ -201,6 +201,24 @@ a b
202 5
203 6
204 7
alter table t1 modify b mediumint;
select * from t1 order by b;
a b
1 1
200 2
0 3
201 4
202 5
203 6
204 7
create table t2 (a int);
insert t2 values (1),(2);
alter table t2 add b int auto_increment primary key;
select * from t2;
a b
1 1
2 2
drop table t2;
delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;
...
...
mysql-test/t/auto_increment.test
View file @
2585b193
...
...
@@ -138,6 +138,13 @@ insert into t1(b)values(5);
insert
into
t1
(
b
)
values
(
6
);
insert
into
t1
(
b
)
values
(
7
);
select
*
from
t1
order
by
b
;
alter
table
t1
modify
b
mediumint
;
select
*
from
t1
order
by
b
;
create
table
t2
(
a
int
);
insert
t2
values
(
1
),(
2
);
alter
table
t2
add
b
int
auto_increment
primary
key
;
select
*
from
t2
;
drop
table
t2
;
delete
from
t1
where
a
=
0
;
update
t1
set
a
=
0
where
b
=
5
;
select
*
from
t1
order
by
b
;
...
...
sql/field.h
View file @
2585b193
...
...
@@ -38,7 +38,7 @@ class Field
public:
static
void
*
operator
new
(
size_t
size
)
{
return
(
void
*
)
sql_alloc
((
uint
)
size
);
}
static
void
operator
delete
(
void
*
ptr_arg
,
size_t
size
)
{
#ifdef
PEDANTIC_
SAFEMALLOC
#ifdef SAFEMALLOC
bfill
(
ptr_arg
,
size
,
0x8F
);
#endif
}
...
...
sql/sql_base.cc
View file @
2585b193
...
...
@@ -2587,7 +2587,7 @@ fill_record(List<Item> &fields,List<Item> &values, bool ignore_errors)
Field
*
rfield
=
field
->
field
;
TABLE
*
table
=
rfield
->
table
;
if
(
rfield
==
table
->
next_number_field
)
table
->
auto_increment_field_not_null
=
true
;
table
->
auto_increment_field_not_null
=
TRUE
;
if
((
value
->
save_in_field
(
rfield
,
0
)
<
0
)
&&
!
ignore_errors
)
DBUG_RETURN
(
1
);
}
...
...
@@ -2608,7 +2608,7 @@ fill_record(Field **ptr,List<Item> &values, bool ignore_errors)
value
=
v
++
;
TABLE
*
table
=
field
->
table
;
if
(
field
==
table
->
next_number_field
)
table
->
auto_increment_field_not_null
=
true
;
table
->
auto_increment_field_not_null
=
TRUE
;
if
((
value
->
save_in_field
(
field
,
0
)
<
0
)
&&
!
ignore_errors
)
DBUG_RETURN
(
1
);
}
...
...
sql/sql_list.h
View file @
2585b193
...
...
@@ -19,9 +19,9 @@
#pragma interface
/* gcc class implementation */
#endif
/* mysql standard class memoryallocator */
/* mysql standard class memory
allocator */
#ifdef
PEDANTIC_
SAFEMALLOC
#ifdef SAFEMALLOC
#define TRASH(XX,YY) bfill((XX), (YY), 0x8F)
#else
#define TRASH(XX,YY)
/* no-op */
...
...
sql/sql_table.cc
View file @
2585b193
...
...
@@ -3271,13 +3271,12 @@ copy_data_between_tables(TABLE *from,TABLE *to,
ha_rows
*
deleted
)
{
int
error
;
Copy_field
*
copy
,
*
copy_end
;
Copy_field
*
copy
,
*
copy_end
,
*
next_field
;
ulong
found_count
,
delete_count
;
THD
*
thd
=
current_thd
;
uint
length
;
SORT_FIELD
*
sortorder
;
READ_RECORD
info
;
Field
*
next_field
;
TABLE_LIST
tables
;
List
<
Item
>
fields
;
List
<
Item
>
all_fields
;
...
...
@@ -3298,7 +3297,12 @@ copy_data_between_tables(TABLE *from,TABLE *to,
{
def
=
it
++
;
if
(
def
->
field
)
{
if
(
*
ptr
==
to
->
next_number_field
)
next_field
=
copy_end
;
(
copy_end
++
)
->
set
(
*
ptr
,
def
->
field
,
0
);
}
}
found_count
=
delete_count
=
0
;
...
...
@@ -3334,7 +3338,7 @@ copy_data_between_tables(TABLE *from,TABLE *to,
error
=
1
;
goto
err
;
}
/* Handler must be told explicitly to retrieve all columns, because
this function does not set field->query_id in the columns to the
current query id */
...
...
@@ -3343,7 +3347,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
if
(
handle_duplicates
==
DUP_IGNORE
||
handle_duplicates
==
DUP_REPLACE
)
to
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
next_field
=
to
->
next_number_field
;
thd
->
row_count
=
0
;
while
(
!
(
error
=
info
.
read_record
(
&
info
)))
{
...
...
@@ -3354,10 +3357,14 @@ copy_data_between_tables(TABLE *from,TABLE *to,
break
;
}
thd
->
row_count
++
;
if
(
next
_field
)
next
_field
->
reset
();
if
(
to
->
next_number
_field
)
to
->
next_number
_field
->
reset
();
for
(
Copy_field
*
copy_ptr
=
copy
;
copy_ptr
!=
copy_end
;
copy_ptr
++
)
{
if
(
copy_ptr
==
next_field
)
to
->
auto_increment_field_not_null
=
TRUE
;
copy_ptr
->
do_copy
(
copy_ptr
);
}
if
((
error
=
to
->
file
->
write_row
((
byte
*
)
to
->
record
[
0
])))
{
if
((
handle_duplicates
!=
DUP_IGNORE
&&
...
...
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