Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7417581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:43:41+00:00 2026-05-29T07:43:41+00:00

I’ve got a table where all fields are set to ‘utf8_general_ci’. There’s a trigger

  • 0

I’ve got a table where all fields are set to ‘utf8_general_ci’. There’s a trigger on the table which captures data changes and inserts them into a ‘log’ table.

The trigger has a variable (var_row_data) which stores the updated row’s old data, and that variable is then inserted into the log table. However, somehow MySQL throws an exception each time a special character (e.g ł and ń) is part of the data stored in the trigger variable.

Am I missing something about trigger variables and their encoding? Connections are using utf8, tables are utf8, webpages are utf8. In short; MySQL handles the special characters just fine but once the trigger tries to store the special characters it all goes wrong.

Does anyone have any experience with this? There’s apparently something going on with the trigger variables, but I just don’t understand how to get around it.

For the record, here’s the trigger:

DROP TRIGGER IF EXISTS `SYM_ON_U_FOR_VRBLS_WBPRD`//
CREATE TRIGGER `SYM_ON_U_FOR_VRBLS_WBPRD` AFTER UPDATE ON `variables`
 FOR EACH ROW begin
                                  DECLARE var_row_data mediumtext;
                                  DECLARE var_old_data mediumtext;
                                  if 1=1 and @sync_triggers_disabled is null then
                                    set var_row_data = concat(
          if(new.`id` is null,'',concat('"',cast(new.`id` as char),'"')),',',
          if(new.`variable` is null,'',concat('"',replace(replace(new.`variable`,'\','\\'),'"','\"'),'"')),',',
          if(new.`value` is null,'',concat('"',replace(replace(new.`value`,'\','\\'),'"','\"'),'"')));
                                    set var_old_data = concat(
          if(old.`id` is null,'',concat('"',cast(old.`id` as char),'"')),',',
          if(old.`variable` is null,'',concat('"',replace(replace(old.`variable`,'\','\\'),'"','\"'),'"')),',',
          if(old.`value` is null,'',concat('"',replace(replace(old.`value`,'\','\\'),'"','\"'),'"')));
                                    if 1=1 then 
                                        insert into trackerdatabase_production_synch.sym_data (table_name, event_type, trigger_hist_id, pk_data, row_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time)
                                        values(
                                          'variables',
                                          'U',
                                          18,
                                          concat(
          if(old.`id` is null,'',concat('"',cast(old.`id` as char),'"'))
                                           ),
                                          var_row_data,
                                          var_old_data,
                                          'default', trackerdatabase_production_synch.sym_transaction_id(), @sync_node_disabled,
                                          null,
                                          CURRENT_TIMESTAMP
                                        );
                                    end if;
                                  end if;
                                end
//
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:43:42+00:00Added an answer on May 29, 2026 at 7:43 am

    Perhaps:

    DECLARE var_row_data MEDIUMTEXT CHARACTER SET utf8;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.