1

Topic: ON DUPLICATE KEY UPDATE

There is a request:

INSERT INTO offers SET ` auto_insert_debug_info ` = ' tui.com* (iphone, ipad) de - non incent ', ` is_requires_approval ` = ' T ', ` link ` = ' None ', ` appnet ` = ' 118 ', ` appinfo_id ` = ' 2525 ', ` is_incent ` = ' F ', ` geo ` = ' de ', ` campaign_appnet_id ` = ' 34438 ', ` appnet_notes ` = ' Suchen, buchen und managen Sie Ihre Reise in einer App! KPI: 30 % bookingNo Re-brokering ', ` install_payout ` = ' 0.75 ', ` identifier ` = ' ', ` is_active ` = ' T ' ON DUPLICATE KEY UPDATE ` auto_insert_debug_info ` = ' tui.com* (iphone, ipad) de - non incent ', ` is_requires_approval ` = ' T ', ` link ` = ' None ', ` appnet ` = ' 118 ', ` appinfo_id ` = ' 2525 ', ` is_incent ` = ' F ', ` geo ` = ' de ', ` campaign_appnet_id ` = ' 34438 ', ` appnet_notes ` = ' Suchen, buchen und managen Sie Ihre Reise in einer App! KPI: 30 % bookingNo Re-brokering ', ` install_payout ` = ' 0.75 ', ` identifier ` = ' ', ` is_active ` ='

I launch on execution. Record does not happen! Thus that record with ` campaign_appnet_id ` = ' 34438 ' in the table precisely is not present (checked)
And generally the data set from ON DUPLICATE KEY UPDATE does not repeat?
Why record does not happen?? What reasons?

2

Re: ON DUPLICATE KEY UPDATE

Areostar wrote:

There is a request:

INSERT INTO offers
SET ` auto_insert_debug_info ` = ' tui.com* (iphone, ipad) de - non incent ',
` is_requires_approval ` = ' T ',
` link ` = ' None ',
` appnet ` = ' 118 ',
` appinfo_id ` = ' 2525 ',
` is_incent ` = ' F ',
` geo ` = ' de ',
` campaign_appnet_id ` = ' 34438 ',
` appnet_notes ` = ' Suchen, buchen und managen Sie Ihre Reise in einer App! KPI: 30 % bookingNo Re-brokering ', ` install_payout ` = ' 0.75 ', ` identifier ` = ", ` is_active ` = ' T ' ON DUPLICATE KEY UPDATE ` auto_insert_debug_info ` = ' tui.com* (iphone, ipad) de - non incent ', ` is_requires_approval ` = ' T ', ` link ` = ' None ', ` appnet ` = ' 118 ', ` appinfo_id ` = ' 2525 ', ` is_incent ` = ' F ', ` geo ` = ' de ', ` campaign_appnet_id ` = ' 34438 ', ` appnet_notes ` = ' Suchen, buchen und managen Sie Ihre Reise in einer App! KPI: 30 % bookingNo Re-brokering ', ` install_payout ` = ' 0.75 ', ` identifier ` =", ` is_active ` = ' T ';

3

Re: ON DUPLICATE KEY UPDATE

Could to format itself also...

Areostar wrote:

There is a request:

INSERT INTO offers
SET ` auto_insert_debug_info ` = ' tui.com* (iphone, ipad) de - non incent ',
` is_requires_approval ` = ' T ',
` link ` = ' None ',
` appnet ` = ' 118 ',
` appinfo_id ` = ' 2525 ',
` is_incent ` = ' F ',
` geo ` = ' de ',
` campaign_appnet_id ` = ' 34438 ',
` appnet_notes ` = ' Suchen, buchen und managen Sie Ihre Reise in einer App! KPI: 30 % bookingNo Re-brokering ',
` install_payout ` = ' 0.75 ',
` identifier ` = ",
` is_active ` = ' T'
ON DUPLICATE KEY
UPDATE ` auto_insert_debug_info ` = ' tui.com* (iphone, ipad) de - non incent ',
` is_requires_approval ` = ' T ',
` link ` = ' None ', ` appnet ` = ' 118 ',
` appinfo_id ` = ' 2525 ',
` is_incent ` = ' F ',
` geo ` = ' de ',
` campaign_appnet_id ` = ' 34438 ',
` appnet_notes ` = ' Suchen, buchen und managen Sie Ihre Reise in einer App! KPI: 30 % bookingNo Re-brokering ',
` install_payout ` = ' 0.75 ',
` identifier ` = ",
` is_active ` = ' T ';

Now show DDL tables. Without it here there is nothing.

4

Re: ON DUPLICATE KEY UPDATE

Here table structure (I built not so  do not kick)

CREATE TABLE ` campaigns ` (
` id ` int (11) NOT NULL AUTO_INCREMENT;
` geo ` varchar (4) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
` is_active ` enum (' T ', ' F ', ' D ', ' M ', ' H ', ' V ', ' R ', ' W ', ' A C ', ' A ', ' S','K ', ' I ') COLLATE utf8mb4_unicode_ci DEFAULT NULL;
` link ` longtext COLLATE utf8mb4_unicode_ci;
` daily_limit ` int (11) NOT NULL DEFAULT ' 0 ';
` installed_today ` int (11) NOT NULL DEFAULT ' 0 ';
` clicked_today ` int (11) NOT NULL DEFAULT ' 0 ';
` comment ` longtext COLLATE utf8mb4_unicode_ci;
` install_start_time ` datetime DEFAULT NULL;
` geofactor ` double NOT NULL DEFAULT ' 1 ';
` fail_detection_app_count ` int (11) NOT NULL DEFAULT ' 0 ';
` fail_detection_fail_count ` int (11) NOT NULL DEFAULT ' 0 ';
` continue_on_fail ` enum (' T ', ' F ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` disbable_cr_notice ` enum (' T ', ' F ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` appnet ` int (11) DEFAULT NULL;
` sub_aff_grp ` int (11) NOT NULL DEFAULT ' 0 ';
` install_payout ` double (5,2) DEFAULT NULL;
` consecutive_fails ` int (11) NOT NULL DEFAULT ' 0 ';
` consecutive_install_fails ` int (11) NOT NULL DEFAULT ' 0 ';
` failed_today ` int (11) NOT NULL DEFAULT ' 0 ';
` failed_installs_today ` int (11) NOT NULL DEFAULT ' 0 ';
` consecutive_fails_limit ` int (11) NOT NULL DEFAULT ' 0 ';
` daily_cr_factor ` float NOT NULL DEFAULT ' 1 ';
` identifier ` varchar (200) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
` store_ver ` varchar (40) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
` store_ver_update_date ` date DEFAULT NULL;
` appinfo_id ` int (11) DEFAULT NULL;
` campaign_appnet_id ` varchar (50) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
` is_incent ` enum (' T ', ' F ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` min_daily_cr ` float DEFAULT NULL;
` max_daily_cr ` float DEFAULT NULL;
` panic_daily_cr ` float DEFAULT NULL;
` min_daily_pay ` float DEFAULT NULL;
` max_daily_pay ` float DEFAULT NULL;
` ip_repeat_failure ` int (11) NOT NULL DEFAULT ' 0 ';
` paused_until ` datetime NOT NULL DEFAULT ' 1970-01-01 0:00:00 AM ';
` campaign_preset ` int (11) DEFAULT NULL;
` cr_fix_factor ` float NOT NULL DEFAULT ' 1 ';
` cr_fix_too_big ` enum (' F ', ' T ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` target_fix_too_big ` enum (' F ', ' T ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` cr ` double (4,4) NOT NULL DEFAULT ' 0.0000 ';
` day_of_week_factor ` double NOT NULL DEFAULT ' 1 ';
` failed_active_campaign_tests ` int (11) NOT NULL DEFAULT ' 0 ';
` installs_target_fix_factor ` double NOT NULL DEFAULT ' 1 ';
` targeted_cr ` double (4,4) DEFAULT NULL;
` targeted_daily_limit ` double DEFAULT NULL;
` last_is_active_change ` datetime NOT NULL DEFAULT ' 1970-01-01 0:00:00 AM ';
` dont_stop_until ` datetime NOT NULL DEFAULT ' 1970-01-01 0:00:00 AM ';
` auto_insert_debug_info ` mediumtext COLLATE utf8mb4_unicode_ci;
` latest_install_date ` datetime DEFAULT NULL;
` appnet_notes ` longtext COLLATE utf8mb4_unicode_ci;
` insert_date ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
` update_date ` datetime DEFAULT NULL;
` just_auto_added ` enum (' T ', ' F ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` auto_insert_comment ` varchar (200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ";
` is_new_offers_insert ` enum (' F ', ' T ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` is_do_not_disabled_by_counterpart ` enum (' T ', ' F ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
` target_clicks_fix_factor ` double NOT NULL DEFAULT ' 1 ';
` target_installs_fix_factor ` double NOT NULL DEFAULT ' 1 ';
` retry_counter ` int (11) NOT NULL DEFAULT ' 0 ';
` last_factor_fix_datetime ` datetime NOT NULL DEFAULT ' 1978-01-01 0:00:00 AM ';
` is_cr_panic ` enum (' T ', ' F ', ' H ') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' F ';
PRIMARY KEY (` id `);
UNIQUE KEY ` appnet ` (` appnet `, ` appinfo_id `);
KEY ` geo ` (` geo `);
KEY ` is_active ` (` is_active `);
KEY ` install_start_time ` (` install_start_time `);
KEY ` appnet_key ` (` appnet `);
KEY ` appinfo ` (` appinfo_id `);
KEY ` appinfo_id ` (` appinfo_id `);
KEY ` identifier ` (` identifier `);
KEY ` campaign_appnet_id ` (` campaign_appnet_id `);
KEY ` campaign_appnet_id_2 ` (` campaign_appnet_id `, ` identifier `);
KEY ` geo_2 ` (` geo `)
) ENGINE=MyISAM AUTO_INCREMENT=204292 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |

5

Re: ON DUPLICATE KEY UPDATE

And where in the table a field ` is_requires_approval `?
Include already error output MySQL. And, however, about what it I... Same it is interesting to nobody.

6

Re: ON DUPLICATE KEY UPDATE

Sorry not that label unpacked))

CREATE TABLE ` offers ` (
` geo ` varchar (4) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ";
` is_active ` enum (' T ', ' F ') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' T ';
` link ` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
` comment ` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
` continue_on_fail ` enum (' T ', ' F ') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' F ';
` disbable_cr_notice ` enum (' T ', ' F ') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' F ';
` appnet ` int (11) DEFAULT NULL;
` sub_aff_grp ` int (11) NOT NULL DEFAULT ' 0 ';
` install_payout ` double (5,2) DEFAULT NULL;
` daily_cr_factor ` float NOT NULL DEFAULT ' 1 ';
` identifier ` varchar (200) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL;
` appinfo_id ` int (11) NOT NULL DEFAULT ' 0 ';
` campaign_appnet_id ` varchar (50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ";
` is_incent ` enum (' T ', ' F ') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' F ';
` auto_insert_debug_info ` text COLLATE utf8mb4_unicode_ci;
` appnet_notes ` text COLLATE utf8mb4_unicode_ci;
` insert_date ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
` update_date ` datetime DEFAULT NULL;
` auto_insert_comment ` varchar (200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ";
` is_requires_approval ` enum (' F ', ' T ') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' F ';
` is_still_appearing ` enum (' T ', ' F ') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ' F ';
` request_url ` text COLLATE utf8mb4_unicode_ci;
` last_activated ` datetime DEFAULT NULL;
` last_install_fail ` datetime DEFAULT NULL;
PRIMARY KEY (` geo `, ` appinfo_id `, ` campaign_appnet_id `);
KEY ` geo ` (` geo `);
KEY ` is_active ` (` is_active `);
KEY ` appnet_key ` (` appnet `);
KEY ` appinfo ` (` appinfo_id `);
KEY ` appinfo_id ` (` appinfo_id `)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |

Request I launch in  -  is not present simply writes that a zero of fields is added!??

7

Re: ON DUPLICATE KEY UPDATE

Sorry records

8

Re: ON DUPLICATE KEY UPDATE

In the table only one unique index (it primary) which can lead ODKU. If writes that a zero of records it is added/is updated, it means that doubling record is available, and values of all fields in ODKU strictly same, as were, any field did not change.

9

Re: ON DUPLICATE KEY UPDATE

PS. And still open for itself function VALUES ().

10

Re: ON DUPLICATE KEY UPDATE

Akina;
ODKU - sounds familiarly, I will go  more in detail
Function VALUES () I know certainly. But the code is written not by me. Also it is written  speaking through *** at so to rewrite to itself can rise more expensively. BUT I feel it is necessary sad(

11

Re: ON DUPLICATE KEY UPDATE

Riddle in  that I requests searched in basis and on ` campaign_appnet_id ` = ' 34438 ' on another  (together with it). But not ! ((