Mayor bug

BubikolRamios's profile image BubikolRamios posted 9 years ago in General Permalink
Data tab
Duplicate row
Values from autoinc and auto timestamp gets copyed to new row.
You can imagine that then insert does not work. There is also then no way to empty(remove from insert) copyed auto timestamp
value.

To remind, I still think that at duplicate row all values should be copyed to new row (with exception of upper cases). Now keyed walues are not copyed. Imagine one have key on 5 fields and has to copy 4 of them manualy just to make new record.

ref table:

CREATE TABLE `tezaver_zunanji_spiski_detail_sources` (
`id_master` INT(10) UNSIGNED NOT NULL,
`term` VARCHAR(100) NOT NULL DEFAULT ' ' COMMENT 'zgolj podsetnik za update id_tezavra' COLLATE 'utf8_slovenian_ci',
`op` TEXT NULL COLLATE 'utf8_slovenian_ci',
`source` VARCHAR(400) NULL DEFAULT NULL COMMENT 'če je več sourcov ' COLLATE 'utf8_slovenian_ci',
`source_sha1` VARCHAR(50) NOT NULL DEFAULT ' ' COLLATE 'utf8_slovenian_ci',
`DSP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`sources_record_id` INT(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id_master`, `term`, `source_sha1`),
UNIQUE INDEX `auto` (`sources_record_id`)
)
COMMENT='viri za trditev, da ta in ta obstaja v tem in tem id_master'
COLLATE='utf8_slovenian_ci'
ENGINE=MyISAM
AUTO_INCREMENT=78680
;

arucard's profile image arucard posted 9 years ago Permalink
There is also then no way to empty(remove from insert) copyed auto timestamp value.

Yes, you can empty values while inserting new row. Select designated cell and press Ctrl+Shift+N (it puts NULL).
BubikolRamios's profile image BubikolRamios posted 9 years ago Permalink
remove from insert (statement)

`DSP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

not to remove ! I want to not to be in insert statement as I want autogenerated DEFAULT CURRENT_TIMESTAMP. I don't want NULL.
arucard's profile image arucard posted 9 years ago Permalink
I think it's correct. You pass NULL value to DSP column during new insert. And because of DEFAULT CURRENT_TIMESTAMP you get correct value.

BubikolRamios's profile image BubikolRamios posted 9 years ago Permalink
Does not work for me. I get null going thru your proc.

CREATE TABLE `test` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`DSP` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`foo` VARCHAR(50) NOT NULL DEFAULT '0',
UNIQUE INDEX `Index 1` (`id`)
)
ENGINE=MyISAM
AUTO_INCREMENT=8


insert into test (foo) values('žblj')


Try duplicating that record.

Itherway , I say duplicate record - reason - I want to spare myself some time not inserting all the stuff manualy, using source record as TEMPLATE.

It is new record with logicaly (for me) new current timestamp.
Employing all my imagination I see no reason under sun that timestamp would be a copy from template record.

An as said before, that new record should have a copy of all keyed values (does not have them now).

Please login to leave a reply, or register at first.