Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORA-01704: string literal too long (Unicode symbols) #1434

Open
realmfoo opened this issue Feb 26, 2021 · 1 comment
Open

ORA-01704: string literal too long (Unicode symbols) #1434

realmfoo opened this issue Feb 26, 2021 · 1 comment

Comments

@realmfoo
Copy link

Describe the bug
"ORA-01704: string literal too long" when inserting string via Insert.IntoTable a string with many wide characters (2 bytes per char).

To Reproduce
Issue #1171 describes a problem but for ascii characters.
Issue #1265 was fixed for limited number of special symbols.
Try to use a unicode text with wide characters of 2 or more bytes in tests.

Expected behavior
No error expected.

Information (please complete the following information):

  • Database Management System: Oracle
  • Database Management System Version: 19c Enterprise Edition Release 19.0.0.0.0

Additional context
Oracle have a limit of string in bytes and not characters. So, we should count bytes correctly for Unicode chars.

@jzabroski
Copy link
Collaborator

@realmfoo Yes, solution is to fix the fix by using ParseCombiningCharacters to respect the underlying string encoding.

Would you be interested in writing a PR?

Here's roughly an example of using parse combining characters that I had saved in Linqpad when the author of #1265 fix provided their PR:

void Main()
{
	const string LargeString = @"
Flex claws on the human's belly and purr like a lawnmower scratch at door to be let outside, get let out then scratch at door immmediately after to be let back in. Meowwww furrier and even more furrier hairball sniff other cat's butt and hang jaw half open thereafter. Sniff sniff allways wanting food, but eat owner's food. Meowing non stop for food chew the plant. Sniff catnip and act crazy really likes hummus so eat all the power cords. That box? i can fit in that box love to play with owner's hair tie. Destroy couch destroy house in 5 seconds or catto munch salmono. Lick plastic bags fish i must find my red catnip fishy fish but when owners are asleep, cry for no apparent reason. Sniff other cat's butt and hang jaw half open thereafter. Leave hair on owner's clothes dismember a mouse and then regurgitate parts of it on the family room floor swat at dog, so i is not fat, i is fluffy shred all toilet paper and spread around the house the dog smells bad. Make plans to dominate world and then take a nap sit on human, yet walk on car leaving trail of paw prints on hood and windshield lick plastic bags. Be a nyan cat, feel great about it, be annoying 24/7 poop rainbows in litter box all day annoy the old grumpy cat, start a fight and then retreat to wash when i lose suddenly go on wild-eyed crazy rampage my water bowl is clean and freshly replenished, so i'll drink from the toilet i is not fat, i is fluffy yet spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce or i show my fluffy belly but it's a trap! if you pet it i will tear up your hand. I want to go outside let me go outside nevermind inside is better nyan fluffness ahh cucumber! hate dog, where is my slave? I'm getting hungry scratch at the door then walk away or cough hairball on conveniently placed pants ccccccccccccaaaaaaaaaaaaaaatttttttttttttttttssssssssssssssss. Mouse is good you understand your place in my world or hide head under blanket so no one can see. Meow in empty rooms i is not fat, i is fluffy or howl on top of tall thing eat a rug and furry furry hairs everywhere oh no human coming lie on counter don't get off counter, so meow meow so pet me pet me don't pet me, and if human is on laptop sit on the keyboard. I will ruin the couch with my claws gnaw the corn cob and plan steps for world domination. Sit on human get video posted to internet for chasing red dot always ensure to lay down in such a manner that tail can lightly brush human's nose relentlessly pursues moth and being gorgeous with belly side up, meow meow we are 3 small kittens sleeping most of our time, we are around 15 weeks old i think, i don’t know i can’t count. Good now the other hand, too find empty spot in cupboard and sleep all day yet chase the pig around the house and eat prawns daintily with a claw then lick paws clean wash down prawns with a lap of carnation milk then retire to the warmest spot on the couch to claw at the fabric before taking a catnap leave dead animals as gifts. Eat all the power cords poop in litter box, scratch the walls.
Good morning sunshine find something else more interesting i like cats because they are fat and fluffy so groom forever, stretch tongue and leave it slightly out, blep, purr like a car engine oh yes, there is my human slave woman she does best pats ever that all i like about her hiss meow litter box is life. Spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce good morning sunshine favor packaging over toy or hack up furballs. Stretch claws in your leg and leave buried treasure in the sandbox for the toddlers sit and stare or Gate keepers of hell get my claw stuck in the dog's ear. Humans,humans, humans oh how much they love us felines we are the center of attention they feed, they clean fish i must find my red catnip fishy fish. Scream at teh bath love and coo around boyfriend who purrs and makes the perfect moonlight eyes so i can purr and swat the glittery gleaming yarn to him (the yarn is from a $125 sweater) leave dead animals as gifts slap the dog because cats rule for claw your carpet in places everyone can see - why hide my amazing artistic clawing skills?. Furrier and even more furrier hairball purr when give birth always hungry for thinking longingly about tuna brine, for meow in empty rooms. You call this cat food ccccccccccccaaaaaaaaaaaaaaatttttttttttttttttssssssssssssssss cats are cute or attack the child or kitten is playing with dead mouse. Bite off human's toes cats woo for chase after silly colored fish toys around the house spit up on light gray carpet instead of adjacent linoleum make meme, make cute face. Eat an easter feather as if it were a bird then burp victoriously, but tender look at dog hiiiiiisssss, for hit you unexpectedly pet my belly, you know you want to; seize the hand and shred it! eat too much then proceed to regurgitate all over living room carpet while humans eat dinner or Gate keepers of hell.
Lay on arms while you're using the keyboard run as fast as i can into another room for no reason pee on walls it smells like breakfast but find box a little too small and curl up with fur hanging out ears back wide eyed and x. Eat owner's food crusty butthole. Toy mouse squeak roll over. Spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce present belly, scratch hand when stroked, so thug cat . Sleeps on my head i will be pet i will be pet and then i will hiss or jump up to edge of bath, fall in then scramble in a mad panic to get out go into a room to decide you didn't want to be in there anyway yet munch on tasty moths. Find empty spot in cupboard and sleep all day eat a rug and furry furry hairs everywhere oh no human coming lie on counter don't get off counter so jump on human and sleep on her all night long be long in the bed, purr in the morning and then give a bite to every human around for not waking up request food, purr loud scratch the walls, the floor, the windows, the humans inspect anything brought into the house, sleep yet destroy couch, but nya nya nyan. Sit by the fire pounce on unsuspecting person yet cats are the world so terrorize the hundred-and-twenty-pound rottweiler and steal his bed, not sorry so claw your carpet in places everyone can see - why hide my amazing artistic clawing skills? so kick up litter. Is good you understand your place in my world i like to spend my days sleeping and eating fishes that my human fished for me we live on a luxurious yacht, sailing proudly under the sun, i like to walk on the deck, watching the horizon, dreaming of a good bowl of milk flex claws on the human's belly and purr like a lawnmower purr for no reason. Milk the cow chirp at birds or cats making all the muffins. Lick butt lick human with sandpaper tongue. Make meme, make cute face kitty scratches couch bad kitty i is not fat, i is fluffy pushes butt to face mesmerizing birds hunt by meowing loudly at 5am next to human slave food dispenser. Under the bed hide at bottom of staircase to trip human yet toy mouse squeak roll over, so you're just gonna scroll by without saying meowdy?. Cats are a queer kind of folk cat slap dog in face the fat cat sat on the mat bat away with paws yet cats are the world. Ignore the squirrels, you'll never catch them anyway open the door, let me out, let me out, let me-out, let me-aow, let meaow, meaow! have a lot of grump in yourself because you can't forget to be grumpy and not be like king grumpy cat so poop on couch or fart in owners food , chase dog then run away. Mark territory get suspicious of own shadow then go play with toilette paper so stinky cat or purrr purr littel cat, little cat purr purr. Lounge in doorway cough hairball, eat toilet paper poop on couch purr like an angel for sleep nap or good now the other hand, too. Swipe at owner's legs crash against wall but walk away like nothing happened stretch. Lick left leg for ninety minutes, still dirty chase red laser dot curl into a furry donut tickle my belly at your own peril i will pester for food when you're in the kitchen even if it's salad . See brother cat receive pets, attack out of jealousy bleghbleghvomit my furball really tie the room together lick left leg for ninety minutes, still dirty but cats woo. Meowwww somehow manage to catch a bird but have no idea what to do next, so play with it until it dies of shock push your water glass on the floor the fat cat sat on the mat bat away with paws. Ask to be pet then attack owners hand mice and swipe at owner's legs. Adventure always cereal boxes make for five star accommodation . Cats are a queer kind of folk cat not kitten around yet good morning sunshine so soft kitty warm kitty little ball of furr howl on top of tall thing but poop on grasses. Hunt by meowing loudly at 5am next to human slave food dispenser meow loudly just to annoy owners meow.
Run up and down stairs bring your owner a dead bird or hiiiiiiiiii feed me now murder hooman toes then cats take over the world see brother cat receive pets, attack out of jealousy, and is good you understand your place in my world. Cough hairball on conveniently placed pants. No, you can't close the door, i haven't decided whether or not i wanna go out scamper paw your face to wake you up in the morning enslave the hooman for immediately regret falling into bathtub yet do not try to mix old food with new one to fool me!. Being gorgeous with belly side up purr and poop on couch, steal the warm chair right after you get up. Man running from cops stops to pet cats, goes to jail white cat sleeps on a black shirt yet purrrrrr jump five feet high and sideways when a shadow moves.
Cough furball cat ass trophy cat not kitten around ccccccccccccaaaaaaaaaaaaaaatttttttttttttttttssssssssssssssss. My left donut is missing, as is my right. Lounge in doorway. Lounge in doorway meow go back to sleep owner brings food and water tries to pet on head, so scratch get sprayed by water because bad cat. Touch water with paw then recoil in horror find empty spot in cupboard and sleep all day morning beauty routine of licking self or catching very fast laser pointer. Cats are cute spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce or spill litter box, scratch at owner, destroy all furniture, especially couch. Being gorgeous with belly side up chase dog then run away destroy the blinds hell is other people yet white cat sleeps on a black shirt refuse to drink water except out of someone's glass so pose purrfectly to show my beauty. In the middle of the night i crawl onto your chest and purr gently to help you sleep love. Hit you unexpectedly i'm going to lap some water out of my master's cup meow. Found somthing move i bite it tail. You call this cat food claw at curtains stretch and yawn nibble on tuna ignore human bite human hand yet what the heck just happened, something feels fishy but if it fits i sits but burrow under covers stare at imaginary bug purrrrrr. Stare at ceiling light what the heck just happened, something feels fishy i heard this rumor where the humans are our owners, pfft, what do they know?! yet sit in a box for hours but if human is on laptop sit on the keyboard. Milk the cow meowing chowing and wowing give attitude, put toy mouse in food bowl run out of litter box at full speed . Kitty poochy scratch yet walk on car leaving trail of paw prints on hood and windshield and if human is on laptop sit on the keyboard ignore the squirrels, you'll never catch them anyway. Ears back wide eyed poop in the plant pot love you, then bite you sleep on dog bed, force dog to sleep on floor yet i’m so hungry i’m so hungry but ew not for that so i am the best. As lick i the shoes eat all the power cords. Intently stare at the same spot sit on human they not getting up ever, attack feet. Plan steps for world domination. Chew iPad power cord present belly, scratch hand when stroked chase mice intrigued by the shower, bite off human's toes.
Rub my belly hiss murf pratt ungow ungow. Cough furball licks your face when in doubt, wash. Fight own tail nya nya nyan. Try to jump onto window and fall while scratching at wall. Love and coo around boyfriend who purrs and makes the perfect moonlight eyes so i can purr and swat the glittery gleaming yarn to him (the yarn is from a $125 sweater) climb a tree, wait for a fireman jump to fireman then scratch his face. Get video posted to internet for chasing red dot get scared by doggo also cucumerro and plop down in the middle where everybody walks and run at 3am, cats are cute if it fits, i sits flee in terror at cucumber discovered on floor. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff sleep in the bathroom sink or drink water out of the faucet. Rub face on owner if it smells like fish eat as much as you wish, yet jump off balcony, onto stranger's head. Kitty power immediately regret falling into bathtub for i is not fat, i is fluffy yet bite nose of your human bring your owner a dead bird. Loved it, hated it, loved it, hated it hell is other people trip owner up in kitchen i want food. If it fits, i sits leave fur on owners clothes run as fast as i can into another room for no reason side-eyes your ""jerk"" other hand while being petted for wake up human for food at 4am.
Attack dog, run away and pretend to be victim stare at the wall, play with food and get confused by dust attack the child for swat at dog, or chase after silly colored fish toys around the house. Wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep again destroy house in 5 seconds i love cats i am one wake up scratch humans leg for food then purr then i have a and relax. Meowwww stare at the wall, play with food and get confused by dust and destroy house in 5 seconds. Has closed eyes but still sees you sit in box. Lick arm hair put toy mouse in food bowl run out of litter box at full speed sit by the fire and jump five feet high and sideways when a shadow moves or love me! wack the mini furry mouse, cat walks in keyboard . Disappear for four days and return home with an expensive injury; bite the vet love you, then bite you for stares at human while pushing stuff off a table, cats are fats i like to pets them they like to meow back. Mew love you, then bite you or hiding behind the couch until lured out by a feathery toy and refuse to leave cardboard box. Chase after silly colored fish toys around the house demand to be let outside at once, and expect owner to wait for me as i think about it grab pompom in mouth and put in water dish for fall asleep on the washing machine loved it, hated it, loved it, hated it what the heck just happened, something feels fishy yet check cat door for ambush 10 times before coming in. I'm bored inside, let me out i'm lonely outside, let me in i can't make up my mind whether to go in or out, guess i'll just stand partway in and partway out, contemplating the universe for half an hour how dare you nudge me with your foot?!?! leap into the air in greatest offense! morning beauty routine of licking self. Chew master's slippers give me some of your food give me some of your food give me some of your food meh, i don't want it. Chill on the couch table purr when give birth run around the house at 4 in the morning playing with balls of wool. Eat a rug and furry furry hairs everywhere oh no human coming lie on counter don't get off counter litter box is life rub whiskers on bare skin act innocent paw at beetle and eat it before it gets away i'm bored inside, let me out i'm lonely outside, let me in i can't make up my mind whether to go in or out, guess i'll just stand partway in and partway out, contemplating the universe for half an hour how dare you nudge me with your foot?!?! leap into the air in greatest offense! meow meow yet loves cheeseburgers. That box? i can fit in that box refuse to drink water except out of someone's glass. Mewl for food at 4am your pillow is now my pet bed decide to want nothing to do with my owner today sit by the fire. Cat jumps and falls onto the couch purrs and wakes up in a new dimension filled with kitty litter meow meow yummy there is a bunch of cats hanging around eating catnip carefully drink from water glass and then spill it everywhere and proceed to lick the puddle but rub my belly hiss good morning sunshine. Try to hold own back foot to clean it but foot reflexively kicks you in face, go into a rage and bite own foot, hard instead of drinking water from the cat bowl, make sure to steal water from the toilet. If it smells like fish eat as much as you wish i love cats i am one wake up scratch humans leg for food then purr then i have a and relax annoy owner until he gives you food say meow repeatedly until belly rubs, feels good yet sleep reaches under door into adjacent room. Eat fish on floor hide at bottom of staircase to trip human. Paw at beetle and eat it before it gets away friends are not food. Chase after silly colored fish toys around the house meow all night so hiss at vacuum cleaner have my breakfast spaghetti yarn for love me!. Refuse to drink water except out of someone's glass claw at curtains stretch and yawn nibble on tuna ignore human bite human hand give attitude, yet plop down in the middle where everybody walks give attitude, and catch eat throw up catch eat throw up bad birds give me attention or face the wrath of my claws. Caticus cuteicus. Destroy couch sit on the laptop sit and stare. Jump up to edge of bath, fall in then scramble in a mad panic to get out run up and down stairs, and ask to be pet then attack owners hand.
Spend six hours per day washing, but still have a crusty butthole sugar, my siamese, stalks me (in a good way), day and night . Stare out cat door then go back inside flee in terror at cucumber discovered on floor. Refuse to leave cardboard box sun bathe ignore the squirrels, you'll never catch them anyway. Run around the house at 4 in the morning cat meoooow i iz master of hoomaan, not hoomaan master of i, oooh damn dat dog leave fur on owners clothes. Knock over christmas tree immediately regret falling into bathtub check cat door for ambush 10 times before coming in yet kitty loves pigs for stretch cat mojo , and eat a plant, kill a hand. Look at dog hiiiiiisssss pee on walls it smells like breakfast. Eats owners hair then claws head. Grab pompom in mouth and put in water dish eat a rug and furry furry hairs everywhere oh no human coming lie on counter don't get off counter but meow meow, i tell my human or scratch leg; meow for can opener to feed me for chew master's slippers. There's a forty year old lady there let us feast.
I heard this rumor where the humans are our owners, pfft, what do they know?! who's the baby, stare at wall turn and meow stare at wall some more meow again continue staring so hunt anything that moves my left donut is missing, as is my right, for stuff and things. Pet me pet me don't pet me. Sugar, my siamese, stalks me (in a good way), day and night . Instead of drinking water from the cat bowl, make sure to steal water from the toilet i love cuddles catching very fast laser pointer, for jump up to edge of bath, fall in then scramble in a mad panic to get out, or woops poop hanging from butt must get rid run run around house drag poop on floor maybe it comes off woops left brown marks on floor human slave clean lick butt now as lick i the shoes. Stuff and things being gorgeous with belly side up ignore the squirrels, you'll never catch them anyway pounce on unsuspecting person eat and than sleep on your face. Cat cat moo moo lick ears lick paws lick butt, for poop in a handbag look delicious and drink the soapy mopping up water then puke giant foamy fur-balls. Fight own tail Gate keepers of hell or favor packaging over toy sleep all day whilst slave is at work, play all night whilst slave is sleeping where is my slave? I'm getting hungry, yet immediately regret falling into bathtub. Pet me pet me don't pet me instantly break out into full speed gallop across the house for no reason. Gnaw the corn cob scratch the postman wake up lick paw wake up owner meow meow poop in a handbag look delicious and drink the soapy mopping up water then puke giant foamy fur-balls so plan steps for world domination destroy couch, chase laser and push your water glass on the floor. Check cat door for ambush 10 times before coming in always ensure to lay down in such a manner that tail can lightly brush human's nose so cats are the world and snuggles up to shoulders or knees and purrs you to sleep. Eat a plant, kill a hand eat fish on floor see owner, run in terror pretend not to be evil. Leave hair on owner's clothes carefully drink from water glass and then spill it everywhere and proceed to lick the puddle destroy couch as revenge there's a forty year old lady there let us feast if it smells like fish eat as much as you wish. Tickle my belly at your own peril i will pester for food when you're in the kitchen even if it's salad intrigued by the shower, but intently sniff hand stretch, yet eat the rubberband and experiences short bursts of poo-phoria after going to the loo cat mojo . Run around the house at 4 in the morning all of a sudden cat goes crazy, scream at teh bath and groom yourself 4 hours - checked, have your beauty sleep 18 hours - checked, be fabulous for the rest of the day - checked or my slave human didn't give me any food so i pooped on the floor and you have cat to be kitten me right meow bite nose of your human. Hate dog chew on cable, yet i’m so hungry i’m so hungry but ew not for that chase red laser dot pet me pet me pet me pet me, bite, scratch, why are you petting me play riveting piece on synthesizer keyboard purr purr purr until owner pets why owner not pet me hiss scratch meow. Put butt in owner's face then cats take over the world cat meoooow i iz master of hoomaan, not hoomaan master of i, oooh damn dat dog. Dont wait for the storm to pass, dance in the rain sleep all day whilst slave is at work, play all night whilst slave is sleeping curl into a furry donut let me in let me out let me in let me out let me in let me out who broke this door anyway , for push your water glass on the floor yet destroy couch as revenge. Bleghbleghvomit my furball really tie the room together meow in empty rooms and eat grass, throw it back up for rub butt on table adventure always. Climb a tree, wait for a fireman jump to fireman then scratch his face leave fur on owners clothes if human is on laptop sit on the keyboard human clearly uses close to one life a night no one naps that long so i revive by standing on chestawaken!, for brown cats with pink ears, and spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce yet plop down in the middle where everybody walks. Groom forever, stretch tongue and leave it slightly out, blep scratch the furniture eat all the power cords. Love me! nya nya nyan run around the house at 4 in the morning. Sleep going to catch the red dot today going to catch the red dot today, curl up and sleep on the freshly laundered towels open the door, let me out, let me out, let me-out, let me-aow, let meaow, meaow!, tickle my belly at your own peril i will pester for food when you're in the kitchen even if it's salad . My slave human didn't give me any food so i pooped on the floor see brother cat receive pets, attack out of jealousy, or hide when guests come over caticus cuteicus. You are a captive audience while sitting on the toilet, pet me peer out window, chatter at birds, lure them to mouth and put butt in owner's face but eat prawns daintily with a claw then lick paws clean wash down prawns with a lap of carnation milk then retire to the warmest spot on the couch to claw at the fabric before taking a catnap or wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep again for eat fish on floor.
Mrow stare out cat door then go back inside, run outside as soon as door open or i hate cucumber pls dont throw it at me run up and down stairs for fall asleep on the washing machine. Love me!. Hide at bottom of staircase to trip human attack like a vicious monster carefully drink from water glass and then spill it everywhere and proceed to lick the puddle yet miaow then turn around and show you my bum. I like fish munch on tasty moths. Steal the warm chair right after you get up snuggles up to shoulders or knees and purrs you to sleep and carefully drink from water glass and then spill it everywhere and proceed to lick the puddle dont wait for the storm to pass, dance in the rain scratch the box. Sleep in the bathroom sink. I like big cats and i can not lie find something else more interesting, and stare out the window push your water glass on the floor. Bathe private parts with tongue then lick owner's face. Peer out window, chatter at birds, lure them to mouth sit by the fire, eat too much then proceed to regurgitate all over living room carpet while humans eat dinner chase red laser dot russian blue. Spit up on light gray carpet instead of adjacent linoleum groom yourself 4 hours - checked, have your beauty sleep 18 hours - checked, be fabulous for the rest of the day - checked destroy couch as revenge yet sniff sniff lick the plastic bag eat the rubberband. Leave fur on owners clothes poop in litter box, scratch the walls. Then cats take over the world catasstrophe allways wanting food. Kitty time attack like a vicious monster so with tail in the air yet chew master's slippers, yet relentlessly pursues moth or wake up human for food at 4am. Refuse to come home when humans are going to bed; stay out all night then yowl like i am dying at 4am pooping rainbow while flying in a toasted bread costume in space, but prance along on top of the garden fence, annoy the neighbor's dog and make it bark let me in let me out let me in let me out let me in let me out who broke this door anyway for sugar, my siamese, stalks me (in a good way), day and night relentlessly pursues moth bite off human's toes. Somehow manage to catch a bird but have no idea what to do next, so play with it until it dies of shock attack like a vicious monster kitty pounce, trip, faceplant you didn't see that no you didn't definitely didn't lick, lick, lick, and preen away the embarrassment for howl uncontrollably for no reason. Cat dog hate mouse eat string barf pillow no baths hate everything cat mojo get suspicious of own shadow then go play with toilette paper yet lick the curtain just to be annoying let me in let me out let me in let me out let me in let me out who broke this door anyway .
";
	EnumTextElementIndexes(LargeString);
}

// Define other methods, classes and namespaces here
private static void EnumTextElementIndexes(String s)
{
	string output = string.Empty;
	
	int[] textElemIndex = StringInfo.ParseCombiningCharacters(s);
	for (int i = 0; i < textElemIndex.Length; i++)
	{
		output += string.Format(
			"Character {0} starts at index {1}{2}",
			i, textElemIndex[i], Environment.NewLine);
	}
	
	Console.WriteLine(output);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants