doc-exports/docs/ddm/umn/ddm_04_0028.html
Hasko, Vladimir a5cc543164 reverting ddm umn to state before last commit in #613
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2024-01-17 13:06:49 +00:00

20 lines
3.8 KiB
HTML

<a name="ddm_04_0028"></a><a name="ddm_04_0028"></a>
<h1 class="topictitle1">How Do I Handle Data with Duplicate Primary Keys in a Table?</h1>
<div id="body1558317076353"><div class="section" id="ddm_04_0028__section2084741620524"><h4 class="sectiontitle">Scenario</h4><p id="ddm_04_0028__p1428715585">If there is already a primary key whose data type is a boundary value, in your DDM instance, duplicate primary keys will be reported when you insert a data record that is beyond the data range of the primary key.</p>
</div>
<div class="section" id="ddm_04_0028__section19261103112313"><h4 class="sectiontitle">Procedure</h4><ol id="ddm_04_0028__ol16991157202614"><li id="ddm_04_0028__li1269925782615"><span>Log in to the RDS console.</span></li><li id="ddm_04_0028__li5699557192613"><span>On the <strong id="ddm_04_0028__b377212919917">Instances</strong> page, locate the RDS for MySQL instance associated with your DDM instance and click the name of the RDS instance.</span></li><li id="ddm_04_0028__li9699557192617"><span>On the <strong id="ddm_04_0028__b1199214190345">Basic Information</strong> page, choose <span class="uicontrol" id="ddm_04_0028__uicontrol399314195345"><b>Parameters</b></span> in the left pane.</span></li><li id="ddm_04_0028__li669945712619"><span>Click the <strong id="ddm_04_0028__b946343123415">Parameters</strong> tab and enter <span class="parmname" id="ddm_04_0028__parmname197001257132611"><b>sql_mode</b></span> in the text box. Then click the expanding button in the <strong id="ddm_04_0028__b1358823213818">Value</strong> column, select <span class="uicontrol" id="ddm_04_0028__uicontrol15788858304"><b>STRICT_ALL_TABLES</b></span> or <span class="uicontrol" id="ddm_04_0028__uicontrol470055782615"><b>STRICT_TRANS_TABLES</b></span>, and click <strong id="ddm_04_0028__b1672233143915">Save</strong>.</span><p><div class="note" id="ddm_04_0028__note626195418286"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="ddm_04_0028__p15661039154815"><strong id="ddm_04_0028__b131183914313">STRICT_ALL_TABLES</strong> and <strong id="ddm_04_0028__b155513459434">STRICT_TRANS_TABLES</strong> are both strict modes. The strict mode controls how MySQL handles invalid or missing values.</p>
<ul id="ddm_04_0028__ul994725414481"><li id="ddm_04_0028__li194725444814">An invalid value might have the wrong data type for the column, or might be out of range.</li><li id="ddm_04_0028__li20556164012504">A value is missing when a new row to be inserted does not contain a value for a non-NULL column that has no explicit DEFAULT clause in its definition.</li><li id="ddm_04_0028__li1516765410496">If the DDM instance version is earlier than 2.4.1.3, do not set <strong id="ddm_04_0028__b1115554481016">sql_mode</strong> to <strong id="ddm_04_0028__b11164154418104">ANSI_QUOTES</strong>. If you set it to <strong id="ddm_04_0028__b416518449102">ANSI_QUOTES</strong>, double quotation marks used for each string will be translated into an identifier during SQL statement execution, making the string invalid.<p id="ddm_04_0028__p7270185511496">For example, <strong id="ddm_04_0028__b157015469104">logic</strong> in <strong id="ddm_04_0028__b071346161012">select * from test where tb = "logic"</strong> cannot be parsed correctly.</p>
</li></ul>
<p id="ddm_04_0028__p744480144416">For more information about SQL modes, see <a href="https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html" target="_blank" rel="noopener noreferrer">Server SQL Modes</a>.</p>
</div></div>
</p></li><li id="ddm_04_0028__li1095123312420"><span>On the <strong id="ddm_04_0028__b8177183210913">Instances</strong> page, restart the DDM instance.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ddm_04_0047.html">RDS-related Questions</a></div>
</div>
</div>