Fix the issue with inaccurate error messages for duplicate rowkey
This commit is contained in:
		| @ -205,12 +205,14 @@ int ObRowsInfo::check_duplicate(ObStoreRow *rows, const int64_t row_count, ObRel | |||||||
|         RowsCompare rows_cmp(*datum_utils_, min_key_, true, ret); |         RowsCompare rows_cmp(*datum_utils_, min_key_, true, ret); | ||||||
|         std::sort(rowkeys_.begin(), rowkeys_.end(), rows_cmp); |         std::sort(rowkeys_.begin(), rowkeys_.end(), rows_cmp); | ||||||
|       } |       } | ||||||
|  |       if (OB_SUCC(ret)) { | ||||||
|         for (int64_t i = 0; i < row_count; i++) { |         for (int64_t i = 0; i < row_count; i++) { | ||||||
|           permutation_[rowkeys_[i].row_idx_] = i; |           permutation_[rowkeys_[i].row_idx_] = i; | ||||||
|         } |         } | ||||||
|         min_key_ = rowkeys_.at(0).marked_rowkey_.get_rowkey(); |         min_key_ = rowkeys_.at(0).marked_rowkey_.get_rowkey(); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|   return ret; |   return ret; | ||||||
| } | } | ||||||
|  | |||||||
| @ -3920,9 +3920,12 @@ int ObLSTabletService::insert_rows_to_tablet( | |||||||
|                                        run_ctx.dml_param_.tz_info_)) { |                                        run_ctx.dml_param_.tz_info_)) { | ||||||
|         LOG_WARN("extract rowkey failed"); |         LOG_WARN("extract rowkey failed"); | ||||||
|       } else { |       } else { | ||||||
|  |         int tmp_ret = OB_SUCCESS; | ||||||
|         ObString index_name = "PRIMARY"; |         ObString index_name = "PRIMARY"; | ||||||
|         if (data_table.is_index_table()) { |         if (data_table.is_index_table()) { | ||||||
|           data_table.get_index_name(index_name); |           data_table.get_index_name(index_name); | ||||||
|  |         } else if (lib::is_oracle_mode() && OB_TMP_FAIL(data_table.get_primary_key_name(index_name))) { | ||||||
|  |           LOG_WARN("Failed to get pk name", K(ret), K(tmp_ret)); | ||||||
|         } |         } | ||||||
|         LOG_USER_ERROR(OB_ERR_PRIMARY_KEY_DUPLICATE, |         LOG_USER_ERROR(OB_ERR_PRIMARY_KEY_DUPLICATE, | ||||||
|                        rowkey_buffer, index_name.length(), index_name.ptr()); |                        rowkey_buffer, index_name.length(), index_name.ptr()); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 obdev
					obdev