-2

when I run select statement from mysql database, characters like \n \t will be escaped. Is there a way to see these original characters in mysql?

What I want to see is something like "java.lang.Exception: Container released on a lost node\r\n\tat"

Bargitta
  • 2,266
  • 4
  • 22
  • 35
  • Don't you really mean the opposite? You're apparently getting the original character (a literal tabulator or a carriage return) and you want to replace if with a escape sequence. – Álvaro González Oct 22 '18 at 11:22
  • @ÁlvaroGonzález I do need to see the original one – Bargitta Oct 22 '18 at 11:30
  • [I cannot reproduce it](https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=8a7905b781885f0e6c19c2add19c8f03). Are you able to create a fiddle that exhibits the issue? – Álvaro González Oct 22 '18 at 11:36
  • Want to do this in a qurey or some programming language? – Salman A Oct 22 '18 at 11:40
  • @SalmanA the issue is that when I run a sql query with select and where statement, I always find there is a mismatch. Sometimes it is due to "\r\n" vs "\n" and sometimes of encoding. However, for these differences, I could not tell from the output by eyes. – Bargitta Oct 23 '18 at 02:20
  • @SalmanA I mean when selecting a varchar field with 'like' or '=' operator, I meet this issue – Bargitta Oct 23 '18 at 02:37

1 Answers1

0

Try this:

SELECT * FROM table 
WHERE column_name REGEXP "\n" 
OR column_name REGEXP "\t";
Mayank Porwal
  • 33,470
  • 8
  • 37
  • 58