Add 02483_cuturlparameter_with_arrays test

This commit is contained in:
Roman Vasin 2022-11-28 16:01:29 +00:00
parent 75b2aaad64
commit b7cac89a8f
3 changed files with 59 additions and 2 deletions

View File

@ -159,7 +159,6 @@ public:
auto field = col_const_array->getData()[j];
cutURL(res_chars, field.get<String>());
}
}
res_data.resize(res_offset + res_chars.size());
memcpySmallAllowReadWriteOverflow15(&res_data[res_offset], &res_chars[0], res_chars.size());
@ -169,7 +168,6 @@ public:
prev_offset = cur_offset;
}
}
};
REGISTER_FUNCTION(CutURLParameter)

View File

@ -0,0 +1,2 @@
http://bigmir.net/?a=b&c=d http://bigmir.net/?c=d http://bigmir.net/? http://bigmir.net/?a=b http://bigmir.net/?c=d# http://bigmir.net/?a# http://bigmir.net/?a&c=d# http://bigmir.net/?a=b&c=d#e=f http://bigmir.net/?c=d#e http://bigmir.net/?a=b#e http://bigmir.net/?a=b&c=d#e http://bigmir.net/?a=b&c=d#test?g=h http://bigmir.net/?a=b&c=d#test?e=f //bigmir.net/?a=b&c=d //bigmir.net/?c=d //bigmir.net/? //bigmir.net/?c=d# //bigmir.net/?a&c=d#e=f //bigmir.net/?a#e=f //bigmir.net/?a&c=d# //bigmir.net/?a=b#e=f //bigmir.net/?#e //bigmir.net/?c=d#e //bigmir.net/?a=b#e&g=h //bigmir.net/?a=b&c=d#e //bigmir.net/?a=b&c=d#test?g=h //bigmir.net/?a=b&c=d#test?e=f
http://bigmir.net/?a=b&c=d http://bigmir.net/?c=d http://bigmir.net/? http://bigmir.net/?a=b http://bigmir.net/?c=d# http://bigmir.net/?a# http://bigmir.net/?a&c=d# http://bigmir.net/?a=b&c=d#e=f http://bigmir.net/?c=d#e http://bigmir.net/?a=b#e http://bigmir.net/?a=b&c=d#e http://bigmir.net/?a=b&c=d#test?g=h http://bigmir.net/?a=b&c=d#test?e=f //bigmir.net/?a=b&c=d //bigmir.net/?c=d //bigmir.net/? //bigmir.net/?c=d# //bigmir.net/?a&c=d#e=f //bigmir.net/?a#e=f //bigmir.net/?a&c=d# //bigmir.net/?a=b#e=f //bigmir.net/?#e //bigmir.net/?c=d#e //bigmir.net/?a=b#e&g=h //bigmir.net/?a=b&c=d#e //bigmir.net/?a=b&c=d#test?g=h //bigmir.net/?a=b&c=d#test?e=f

View File

@ -0,0 +1,57 @@
SELECT
cutURLParameter('http://bigmir.net/?a=b&c=d', []),
cutURLParameter('http://bigmir.net/?a=b&c=d', ['a']),
cutURLParameter('http://bigmir.net/?a=b&c=d', ['a', 'c']),
cutURLParameter('http://bigmir.net/?a=b&c=d', ['c']),
cutURLParameter('http://bigmir.net/?a=b&c=d#e=f', ['a', 'e']),
cutURLParameter('http://bigmir.net/?a&c=d#e=f', ['c', 'e']),
cutURLParameter('http://bigmir.net/?a&c=d#e=f', ['e']),
cutURLParameter('http://bigmir.net/?a=b&c=d#e=f&g=h', ['b', 'g']),
cutURLParameter('http://bigmir.net/?a=b&c=d#e', ['a', 'e']),
cutURLParameter('http://bigmir.net/?a=b&c=d#e&g=h', ['c', 'g']),
cutURLParameter('http://bigmir.net/?a=b&c=d#e&g=h', ['e', 'g']),
cutURLParameter('http://bigmir.net/?a=b&c=d#test?e=f&g=h', ['test', 'e']),
cutURLParameter('http://bigmir.net/?a=b&c=d#test?e=f&g=h', ['test', 'g']),
cutURLParameter('//bigmir.net/?a=b&c=d', []),
cutURLParameter('//bigmir.net/?a=b&c=d', ['a']),
cutURLParameter('//bigmir.net/?a=b&c=d', ['a', 'c']),
cutURLParameter('//bigmir.net/?a=b&c=d#e=f', ['a', 'e']),
cutURLParameter('//bigmir.net/?a&c=d#e=f', ['a']),
cutURLParameter('//bigmir.net/?a&c=d#e=f', ['a', 'c']),
cutURLParameter('//bigmir.net/?a&c=d#e=f', ['a', 'e']),
cutURLParameter('//bigmir.net/?a=b&c=d#e=f&g=h', ['c', 'g']),
cutURLParameter('//bigmir.net/?a=b&c=d#e', ['a', 'c']),
cutURLParameter('//bigmir.net/?a=b&c=d#e', ['a', 'e']),
cutURLParameter('//bigmir.net/?a=b&c=d#e&g=h', ['c', 'e']),
cutURLParameter('//bigmir.net/?a=b&c=d#e&g=h', ['e', 'g']),
cutURLParameter('//bigmir.net/?a=b&c=d#test?e=f&g=h', ['test', 'e']),
cutURLParameter('//bigmir.net/?a=b&c=d#test?e=f&g=h', ['test', 'g']);
SELECT
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d'), []),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d'), ['a']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d'), ['a', 'c']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d'), ['c']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#e=f'), ['a', 'e']),
cutURLParameter(materialize('http://bigmir.net/?a&c=d#e=f'), ['c', 'e']),
cutURLParameter(materialize('http://bigmir.net/?a&c=d#e=f'), ['e']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#e=f&g=h'), ['b', 'g']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#e'), ['a', 'e']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#e&g=h'), ['c', 'g']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#e&g=h'), ['e', 'g']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#test?e=f&g=h'), ['test', 'e']),
cutURLParameter(materialize('http://bigmir.net/?a=b&c=d#test?e=f&g=h'), ['test', 'g']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d'), []),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d'), ['a']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d'), ['a', 'c']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#e=f'), ['a', 'e']),
cutURLParameter(materialize('//bigmir.net/?a&c=d#e=f'), ['a']),
cutURLParameter(materialize('//bigmir.net/?a&c=d#e=f'), ['a', 'c']),
cutURLParameter(materialize('//bigmir.net/?a&c=d#e=f'), ['a', 'e']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#e=f&g=h'), ['c', 'g']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#e'), ['a', 'c']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#e'), ['a', 'e']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#e&g=h'), ['c', 'e']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#e&g=h'), ['e', 'g']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#test?e=f&g=h'), ['test', 'e']),
cutURLParameter(materialize('//bigmir.net/?a=b&c=d#test?e=f&g=h'), ['test', 'g']);