Console is freezing in 9.3.5

Hello,

The issue wasn’t present in 9.3.4 but since I have installed 9.3.5, I got the console looping forever and freezing when trying to add any character to the following code:

SELECT * FROM (
SELECT timestamp, vn, matmul(vn, transpose(mc))[1] as vnp,matmul(vs, transpose(mc))[1] as vsp FROM (
SELECT timestamp,
array[[1.182,0.000,0.000,0.001,0.000,0.000,-0.008,0.001,0.000,-0.050,0.000,0.001,0.000,0.000],
[0.000,1.192,-0.002,-0.112,-0.010,-0.012,0.000,-0.007,-0.016,-0.004,-0.039,0.003,0.001,-0.027],
[-0.003,-0.008,1.222,-0.087,-0.065,0.000,0.000,-0.007,-0.004,0.003,-0.003,-0.010,0.000,0.001],
[0.000,-0.003,0.000,1.311,-0.002,0.000,0.000,0.000,-0.001,-0.032,-0.004,-0.012,0.000,0.000],
[0.000,-0.013,-0.076,0.007,1.243,-0.001,0.000,-0.008,-0.027,-0.008,-0.002,0.001,0.000,0.002],
[0.003,-0.034,-0.008,-0.074,-0.011,1.121,-0.017,-0.076,0.003,0.005,0.003,-0.006,0.003,0.000],
[-0.174,0.003,0.006,-0.017,-0.013,-0.068,1.034,-0.066,-0.006,-0.092,-0.006,-0.089,-0.003,0.001],
[-0.001,-0.047,-0.064,-0.018,-0.033,-0.037,-0.007,1.277,-0.114,-0.014,-0.008,-0.033,-0.043,-0.125],
[0.000,-0.074,-0.080,0.015,-0.097,-0.003,0.000,-0.098,1.169,0.002,-0.042,-0.006,0.005,-0.025],
[-0.008,0.000,0.000,-0.029,-0.002,0.000,-0.001,0.000,0.000,1.197,-0.008,-0.005,0.000,0.000],
[0.000,-0.002,0.001,0.000,-0.004,0.000,0.000,-0.001,-0.003,0.000,1.159,-0.038,0.001,-0.008],
[0.000,-0.002,0.000,0.001,0.001,0.000,-0.002,-0.006,-0.001,-0.007,-0.040,1.200,-0.006,-0.018],
[0.000,0.000,0.000,0.000,0.000,0.000,0.000,-0.001,0.000,0.000,-0.003,-0.005,1.087,-0.026],
[0.000,-0.012,0.001,0.001,-0.008,0.000,0.000,-0.007,-0.001,0.000,-0.008,0.001,-0.046,1.224]] as mc,
ARRAY[a,b,c,d,e,f,g,h,i,j,k,l,m,n] as vn,
ARRAY[
  case when a_s = null THEN 0 ELSE a_s END, 
  case when b_s = null THEN 0 ELSE b_s END,
  case when c_s = null THEN 0 ELSE c_s END,
  case when d_s = null THEN 0 ELSE d_s END,
  case when e_s = null THEN 0 ELSE e_s END,
  case when f_s = null THEN 0 ELSE f_s END,
  case when g_s = null THEN 0 ELSE g_s END,
  case when h_s = null THEN 0 ELSE h_s END,
  case when i_s = null THEN 0 ELSE i_s END,
  case when j_s = null THEN 0 ELSE j_s END,
  case when k_s = null THEN 0 ELSE k_s END,
  case when l_s = null THEN 0 ELSE l_s END,
  case when m_s = null THEN 0 ELSE m_s END,
  case when n_s = null THEN 0 ELSE n_s END
  ] as vs FROM (
    select 
timestamp,
count(CASE WHEN class_name = 'CA' THEN 1 END) as a, 
SUM(CASE WHEN class_name = 'CA' THEN surface END) as a_s,
count(CASE WHEN class_name = 'CB' THEN 1 END) as b,
SUM(CASE WHEN class_name = 'CB' THEN surface END) as b_s,
count(CASE WHEN class_name = 'CC' THEN 1 END) as c,
SUM(CASE WHEN class_name = 'CC' THEN surface END) as c_s,
count(CASE WHEN class_name = 'CD' THEN 1 END) as d,
SUM(CASE WHEN class_name = 'CD' THEN surface END) as d_s,
count(CASE WHEN class_name = 'CE' THEN 1 END) as e,
SUM(CASE WHEN class_name = 'cE' THEN surface END) as e_s,
count(CASE WHEN class_name = 'CF' THEN 1 END) as f,
SUM(CASE WHEN class_name = 'CF' THEN surface END) as f_s,
count(CASE WHEN class_name = 'CG' THEN 1 END) as g,
SUM(CASE WHEN class_name = 'CG' THEN surface END) as g_s,
count(CASE WHEN class_name = 'CH' THEN 1 END) as h,
SUM(CASE WHEN class_name = 'CH' THEN surface END) as h_s,
count(CASE WHEN class_name = 'CI' THEN 1 END) as i,
SUM(CASE WHEN class_name = 'CI' THEN surface END) as i_s,
count(CASE WHEN class_name = 'CJ' THEN 1 END) as j,
SUM(CASE WHEN class_name = 'CJ' THEN surface END) as j_s,
count(CASE WHEN class_name = 'CK' THEN 1 END) as k,
SUM(CASE WHEN class_name = 'CK' THEN surface END) as k_s,
count(CASE WHEN class_name = 'CL' THEN 1 END) as l,
SUM(CASE WHEN class_name = 'CL' THEN surface END) as l_s,
count(CASE WHEN class_name = 'CM' THEN 1 END) as m,
SUM(CASE WHEN class_name = 'CM' THEN surface END) as m_s,
count(CASE WHEN class_name = 'CN' THEN 1 END) as n, 
SUM(CASE WHEN class_name = 'CN' THEN surface END) as n_s, 
from my_table where timestamp in today() SAMPLE BY 15s))
) TRYING TO ADD A CHARARACTER HERE
;

The subquery starting from the SELECT on the second line works fine… but adding a new SELECT encapsulating this query or after naming this subquery with the keyword WITH raises the issue, even if the final query is valid and working.

For example, if I try just to write " limit 10", I can’t type it but I can paste it and it is executed properly.

What would you need to fix it ? Can I deactivate the realtime SQL validation somehow ?

Hey @Gabriel ,

That’s very strange, if you could help us reproduce it on our side, that’d be great. A DDL for my_table plus your browser name and version would good.

I’ll tag @Emre_Kaya who will be able to fix any web console issues.

Hey @Gabriel,

Thanks for reaching out. I was able to reproduce the issue on my end.

The problem is related to the parser we use for inline suggestions in the editor. It was getting stuck while parsing the trailing comma in the last item of your SELECT list, specifically in this line:
SUM(CASE WHEN class_name = 'CN' THEN surface END) as n_s,
in my_table select list.
I have worked on the issue and fixed it for the next release. I also added safeguards to prevent this situation from happening again in the future. You can check the details if you’re interested.

As a temporary workaround, removing the trailing comma mentioned above should resolve the issue.

Sorry for the inconvenience,
Emre

I found the issue in my SQL request… if I remove the comma between n_s and from, then the issue dissapears. As you may understand, it is due to copy/paste.

That’s why everything I could modify anything before it but not after.